jquery-1.5

jQuery version 1.5 - ajax - <script> tag timestamp problem

假装没事ソ 提交于 2019-11-27 22:10:38
问题 If I load some content with ajax (jQuery) which has a script tag in it, jQuery 1.5 adds the timestamp to the script tag src url. See example bellow. Example: content what I load with ajax: <div>text1</div> <script type="text/javascript" src="/js/abc-xyz.js?r=1.1"></script> This is the src url from where it loads the script code after I insert the previous content to the page: .../js/abc-xyz.js?r=1.1&_=1297892228466 Does anybody knows why this happening? It happens only with jQuery 1.5. It

jQuery jqXHR - cancel chained calls, trigger error chain

你说的曾经没有我的故事 提交于 2019-11-27 12:53:37
I am creating a ajax utility for interfacing with my server methods. I would like to leverage jQuery 1.5+ deferred methods from the object returned from the jQuery.ajax() call. The situation is following. The serverside method always returns a JSON object: { success: true|false, data: ... } The client-side utility initiates the ajax call like this var jqxhr = $.ajax({ ... }); And the problem area: jqxhr.success(function(data, textStatus, xhr) { if(!data || !data.success) { ???? // abort processing, trigger error } }); return jqxhr; // return to caller so he can attach his own handlers So the

JQuery Conflicts with Primefaces? [duplicate]

被刻印的时光 ゝ 提交于 2019-11-26 18:27:23
This question already has an answer here: Adding jQuery to PrimeFaces results in Uncaught TypeErrors 1 answer I have included JQuery1.5 in the header of a JSF page. In that page there is a bunch of Primefaces components already coded. After I have included the Jquery.js in the header of the page, some primefaces components like <p:commandButton> loses their skin and <p:fileUpload> becomes looking like normal JSP <input type="file"> and losing its AJAX capability entirely. Is there a way to use JQuery safely along with primefaces(without conflict)? I had the same problem as described in the

parsererror after jQuery.ajax request with jsonp content type

情到浓时终转凉″ 提交于 2019-11-26 12:22:44
I am using jQuery Version 1.5.1 to do the following ajax call: $.ajax({ dataType: 'jsonp', data: { api_key : apiKey }, url: "http://de.dawanda.com/api/v1/" + resource + ".json", success: function(data) { console.log(data); }, error: function(jqXHR, textStatus, errorThrown) { console.log(errorThrown); console.log(textStatus); } }); The server responds with a valid json object: { "response": { "type":"category", "entries":1, "params":{ "format":"json", "api_key":"c9f11509529b219766a3d301d9c988ae9f6f67fb", "id":"406", "callback":"jQuery15109935275333671539_1300495251986", "_":"1300495252693" },

JQuery Conflicts with Primefaces? [duplicate]

大城市里の小女人 提交于 2019-11-26 08:53:36
问题 This question already has an answer here: Manually adding / loading jQuery with PrimeFaces results in Uncaught TypeErrors 1 answer I have included JQuery1.5 in the header of a JSF page. In that page there is a bunch of Primefaces components already coded. After I have included the Jquery.js in the header of the page, some primefaces components like <p:commandButton> loses their skin and <p:fileUpload> becomes looking like normal JSP <input type=\"file\"> and losing its AJAX capability

How to get response status code from jQuery.ajax?

*爱你&永不变心* 提交于 2019-11-26 00:38:54
In the following code, all I am trying to do is to get the HTTP response code from a jQuery.ajax call. Then, if the code is 301 (Moved Permanently), display the 'Location' response header: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>jQuery 301 Trial</title> <script src="http://code.jquery.com/jquery-1.5.1.min.js"></script> <script type="text/javascript"> function get_resp_status(url) { $.ajax({ url: url,