jquery-1.5

How to use jQuery Deferred with custom events?

别来无恙 提交于 2019-12-29 14:15:14
问题 I have two abstracted processes (e.g. managed within js objects using the revealing module pattern that do not expose their internals) that fire custom events when they complete. I want to perform an action when both custom events have fired. The new Deferred logic in jQuery 1.5 seems like it would be an ideal way to manage this, except that the when() method takes Deferred objects that return a promise() (or normal js objects, but then when() completes immediately instead of waiting, which

jQuery Simple Spy no longer works with jQuery 1.5

梦想与她 提交于 2019-12-22 13:53:14
问题 I'm trying to use Remy Sharp's Simple Spy (http://jqueryfordesigners.com/simple-jquery-spy-effect) with jQuery 1.5. It works fine with 1.4, but in 1.5 it does not load any additional comments after the first one disappears. Can anyone see what needs to be updated in the code so it will work with 1.5? $(function () { $('ul.spy').simpleSpy(); }); (function ($) { $.fn.simpleSpy = function (limit, interval) { limit = limit || 4; interval = interval || 4000; return this.each(function () { // 1.

jQuery Simple Spy no longer works with jQuery 1.5

时光总嘲笑我的痴心妄想 提交于 2019-12-22 13:52:47
问题 I'm trying to use Remy Sharp's Simple Spy (http://jqueryfordesigners.com/simple-jquery-spy-effect) with jQuery 1.5. It works fine with 1.4, but in 1.5 it does not load any additional comments after the first one disappears. Can anyone see what needs to be updated in the code so it will work with 1.5? $(function () { $('ul.spy').simpleSpy(); }); (function ($) { $.fn.simpleSpy = function (limit, interval) { limit = limit || 4; interval = interval || 4000; return this.each(function () { // 1.

jQuery 1.5 AJAX call fails with “invalid label” for JSON requests

↘锁芯ラ 提交于 2019-12-18 13:17:00
问题 I've just upgraded from version 1.4 to version 1.5 of jQuery, and now my AJAX calls always fail with the "invalid label" error. An example request is: jQuery.ajax({ async: false , dataType: "json" , error: function (xhr, status, error) { ... } , success: function (data, status, xhr) { ... } , type: "post" , url: "ajax/request.asp" }); On the net I found this error is raised when the returned JSON is not wrapped with jQuery's callback (e.g. jQuery1234({ "something": "abcd" }) . The problem is

Upgrading from jQuery 1.3.2 to jQuery 1.5 (or 1.4)

落爺英雄遲暮 提交于 2019-12-18 04:28:07
问题 I remember when jQuery 1.4 came out, there was a upgrade link and text where it said that there where stuff that was changed, and stuff we had to rewrite for it to work in 1.4. I can't find this link anymore, because I now want to upgrade to 1.5 from 1.3.2 but I want to be sure everything still works. Does anybody know of the differences and have a link I can use to upgrade correctly? 回答1: The differences between 1.3.2 are listed here: http://jquery14.com/day-01/jquery-14 And the release

jQuery jqXHR - cancel chained calls, trigger error chain

拜拜、爱过 提交于 2019-12-17 10:46:36
问题 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

parsererror after jQuery.ajax request with jsonp content type

喜欢而已 提交于 2019-12-17 02:30:08
问题 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":

How to get response status code from jQuery.ajax?

落花浮王杯 提交于 2019-12-16 22:38:23
问题 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

jQuery 1.5 - JSON error invalid label

不想你离开。 提交于 2019-12-12 01:53:35
问题 I am getting the invalid label error now I have upgraded my jQuery. I read that the new 1.5 version is now more strict on the JSON encoding. Although I use Zend_Json::encode(array("content"=>$result)); to encode the HTML so would of thought this would . I read in the manual that it has been updated although cant get this to work without parse errors. jQuery JSON Manual Error: invalid label Source File: http://domain.local/register/# Line: 0, Column: 1 Source Code: {"content":"<div id=\

how to handle httpStatuscode correctly

我的梦境 提交于 2019-12-07 05:59:32
问题 I would like to react on http status-codes (like 200, 201 or 202) with the new feature (http://api.jquery.com/jQuery.ajax). But the function is ignoring my 201 and 202 callbacks. This error occures with firefox-4.0_b10 and chromium-9.0 I'm looking forward to fix this little issue. Regards Stefan My code-snipped: jQuery.ajax({ url: url, dataType: 'json', statusCode: { 404:function() { alert("404"); }, 200:function() { alert("200"); }, 201:function() { alert("201"); }, 202:function() { alert(