Tag Archives: javascript

Download excel file in javascript from Rest API response content-disposition outputs [Object, Object]

Questions: I want to download a excel file from my angularJs code. Where i made a http post request to Java Rest API and returned the file with header “Content-Disposition” : “attachment; filename=\”new_excel_file.xlsx\”” Java Code @Post @Path(“/excel/trekResult”) @Produces(“application/vnd.ms-excel”) public Response getResultsReport(@HeaderParam(Constants.ID) Long userId, @QueryParam(Constants.COMPANY_TREK_ID) Integer companyTrekId) { String CONTENT_DESPOSITION = “Content-Disposition”; String CONTENT_ATTACHEMENT = “attachment;… Read More »

Save Base64 String as an Excel .xls file using JavaScript in IE 7

Questions: I have been trying to find a way to save a Base64 String in IE 7 using JavaScript as a Excel .xls file. The following works fine with FireFox: window.open (“data:application/vnd.ms-excel;base64,” + bytestring, “”, “width=300,height=300,resizable=1”); where bytestring is the Base64 string. This method however does not work for IE 7. Having done some internet… Read More »

Javascript sorting to match SQL Server sorting

Questions: Can anyone point me towards a sorting algorithm in javascript that would sort the same way SQL Server does (for nvarchar/unicode columns)? For reference, my previous question about this behavior can be found here: SQL Server 2008 – different sort orders on VARCHAR vs NVARCHAR values Rather than attempting to change the sorting behavior… Read More »

handshaking a SQL server with Javascript

Questions: I want to try, as a learning excersise, get my javascript to chat to sql. var ws = new WebSocket(“ws://”); doesn’t seem to be a blocked port, so it should in theory work. I am looking for a breakdown of how to handshake with the sql server, and chat with it. A pointer in… Read More »

Get Ajax POST data on php via Javascript call

Questions: First I am conface that I am Newbie to php, I am using jquery(knockout js) at client side & PHP at server side. my code. Client side: I am using knockout js(Javascript). to call my PHP service. My Code: self.VMSaveEditUserMode = function () { try { var params = { “ClientData”: [controllerVM_.ClientID(), controllerVM_.VMList[0].ClientName(), controllerVM_.VMList[0].ShortName(),… Read More »

Javascript parser for Java [closed]

Questions: Anyone can recommend a decent Javascript parser for Java? I believe Rhino can be used, however it seems an overkill for just doing parsing, or is it the only decent solution? Any suggestion would be greatly appreciated. Thanks. Answers: From https://github.com/google/caja/blob/master/src/com/google/caja/parser/js/Parser.java The grammar below is a context-free representation of the grammar this parser parses.… Read More »