Tag: jquery 1.5

JQuery与Primefaces冲突?

我在JSF页面的头文件中包含了JQuery1.5。 在那个页面中有一堆已经编码的Primefaces组件。 在页面头部包含了Jquery.js之后,像<p:commandButton>这样的一些primefaces组件失去了它们的外观,并且<p:fileUpload>变得像普通的JSP <input type="file"> ,失去了它的AJAX能力完全。 有没有办法安全地使用jQuery与primefaces(没有冲突)?

使用jsonp内容types的jQuery.ajax请求之后的parseError

我正在使用jQuery版本1.5.1来执行以下ajax调用: $.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); } }); 服务器响应一个有效的json对象: { "response": { "type":"category", "entries":1, "params":{ "format":"json", "api_key":"c9f11509529b219766a3d301d9c988ae9f6f67fb", "id":"406", "callback":"jQuery15109935275333671539_1300495251986", "_":"1300495252693" }, "pages":1, "result":{ "category":{ "product_count":0, "id":406, "restful_path":"/categories/406", "parent_id":null, "name":"Oberteile" } } } } […]

如何从jQuery.ajax获取响应状态代码?

在下面的代码中,我所要做的就是从jQuery.ajax调用中获取HTTP响应代码。 然后,如果代码是301(永久移动),则显示“位置”响应标题: <?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, complete: function (jqxhr, txt_status) { console.log ("Complete: [ " + txt_status + " ] " + jqxhr); // if (response code is 301) { […]