client-side

Write to a file without external JS libraries (pure Javascript) in a browser ?

房东的猫 提交于 2020-01-06 02:05:05
问题 Is it possible to write a string to a file (create the file if it doesn't exist) without any external Javascript libraries , purely with Javascript code ? I'm trying to implement a client side code that whenever it reaches a page (.ASPX) it writes few strings into a file (let's say output.txt ) and that's it . From everything I see over the internet , JavaScript is not allowed to write anything to the hard drive . Is that so ? no workarounds ? 回答1: As said in the comments, what you sound to

Struts 2.0 download file from Server

梦想的初衷 提交于 2020-01-04 15:32:46
问题 I have create download method to download file from server-side to client-side, but I had this error appear, the file is successfully downloaded to client-side tough, but I have this error so I can't return to previous page properly. This is my error: SEVERE: Servlet.service() for servlet default threw exception java.lang.RuntimeException: org.apache.jasper.JasperException: java.lang.IllegalStateException: getOutputStream() has already been called for this response at com.opensymphony

Client side event that fires after ASPxClientGridView.ApplyFilter performs its work

社会主义新天地 提交于 2020-01-04 14:02:23
问题 This link explains how to handle it on the server side via the ASPxGridView.AfterPerformCallback event: http://www.devexpress.com/Support/Center/p/Q274366.aspx How can I handle it on the client side? I am working on a custom server control and I have this client side function on my control: applyFilterToGridView: function () { this.theGridView.ApplyFilter(this.filterCondition); this.filterAppliedEvent(); } Because ApplyFilter does a callback, this.filterAppliedEvent() is not called at the

Consistent Client Side Date/timestamp using JavaScript(considering TimeZones)

主宰稳场 提交于 2020-01-04 09:03:01
问题 My question is regarding this quote from the manual about dates in JavaScript: Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. new Date('2016-04-14') output for a user was Wed Apr 13 2016 17:00:00 GMT-0700 (US Mountain Standard Time) upon which he had to use .toUTCString() . How to handle this if the users are in many different time zones? 回答1: new Date().getTime(); returns an

Consistent Client Side Date/timestamp using JavaScript(considering TimeZones)

廉价感情. 提交于 2020-01-04 08:59:11
问题 My question is regarding this quote from the manual about dates in JavaScript: Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. new Date('2016-04-14') output for a user was Wed Apr 13 2016 17:00:00 GMT-0700 (US Mountain Standard Time) upon which he had to use .toUTCString() . How to handle this if the users are in many different time zones? 回答1: new Date().getTime(); returns an

Consistent Client Side Date/timestamp using JavaScript(considering TimeZones)

会有一股神秘感。 提交于 2020-01-04 08:59:00
问题 My question is regarding this quote from the manual about dates in JavaScript: Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. new Date('2016-04-14') output for a user was Wed Apr 13 2016 17:00:00 GMT-0700 (US Mountain Standard Time) upon which he had to use .toUTCString() . How to handle this if the users are in many different time zones? 回答1: new Date().getTime(); returns an

Catch Client Side Validation failure

混江龙づ霸主 提交于 2020-01-03 16:51:10
问题 I've got a form that I'm submitting based on a div click. I also have it launching a waiting indicator when clicked. I'm trying to find out if there is a way to detect if client side validation failed or not so that I can remove the waiting indicator/never show it after a submit attempt...or can I call the the client side validation manually before I attempt the submit? 回答1: you can try $('div').click(function() { if ($('form').valid()) { //form is valid else{ //invalid form } } }); 来源: https

Binding javascript keypress events

旧城冷巷雨未停 提交于 2020-01-03 14:14:15
问题 I have a need to monitor the state of the Shift key, whether it is up or down. Its purpose is to notify the user that while the shift key is held down, the drag and drop operation they are about to perform is going to COPY the node(s), and not move them. I have it working perfectly with the code below, however, if I hold the Shift key and perform the drag and drop, the hook no longer exists; the screen no longer responds to the key press and remains in the "pressed" state. I'm guessing there

Can I change the page's HTML status code on the client side?

让人想犯罪 __ 提交于 2020-01-03 12:58:52
问题 I have a static HTML web page and I want to set its status code to 404 "Not found". But, I want to do this using javascript or jQuery, not any server side language. How can I do this on the client? With javascript or maybe a <meta> tag? 回答1: It is impossible to set the HTTP Response code using client side programming. 回答2: I think the sense behind this exercise is the following: You want to load a page that displays a custom error message to your users. At the same time you want to tell your

Check if user is blocking 3rd party domain

痞子三分冷 提交于 2020-01-02 05:56:11
问题 I have run into an issue where a lot of our support calls are about our images not loading because the user is blocking amazon s3 or a similar 3rd party service. I use 3rd party services for hosting images, video, and some javascript. Is there a way to detect through javascript if a client is blocking a domain so that we display a message instead of having the user contact support? $.ajax 'http://aws.amazon.com/s3/', type: 'GET', dataType: 'html' complete: (e, xhr, settings) -> if e.status ==