firefox3.6

“not well-formed” warning when loading client-side JSON in Firefox via jQuery.ajax

时光怂恿深爱的人放手 提交于 2019-11-26 16:54:49
问题 I am using jQuery's ajax method to acquire a static JSON file. The data is loaded from the local file system, hence there is no server, so I can't change the MIME type. This works fine in Safari, but Firefox (3.6.3) reports the file to be "not well-formed". I am aware of, and have reviewed, a similar post here on Stack Overflow: "not well-formed" error in Firefox when loading JSON file with XMLHttpRequest I believe my JSON is well-formed: { "_": ["appl", "goog", "yhoo", "vz", "t"] } My ajax

Check Ctrl / Shift / Alt keys on 'click' event

﹥>﹥吖頭↗ 提交于 2019-11-26 16:10:51
How could I identify which Ctrl / Shift / Alt keys are pressed in the following code ? $("#my_id").click(function() { if (<left control key is pressed>) { alert("Left Ctrl"); } if (<right shift and left alt keys are pressed>) { alert("Right Shift + Left Alt"); } }); Well you this wont work in all browsers just IE 8. Microsoft implemented the ability to determine which (right/left) key was pressed. Here is a link http://msdn.microsoft.com/en-us/library/ms534630(VS.85).aspx I also found this wonder article about keypress, keyup, keydown event in browsers. http://unixpapa.com/js/key.html $('