jquery-1.9

jquery: how to get a row of json data from the json data list by id, etc?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 23:25:00
问题 I have a json data like this below, how can I select the row of data by its id or by its email , etc? [ Object { id="40", full_name="lau", email="kok@com", more...}, Object { id="39", full_name="Kok", email="lau@lauthiamkok.net", more...}, Object { id="5", full_name="Alice", email="alice@umbrellacorp.com", more...}, 4 more... ] if I do this, console.log(app.contacts[0]); I always get the first row only. Can I use jquery.get() to get a row from the list, something like this below? console.log

Making a variable in jquery 1.9.1 fails and in 1.8.3 doesn't

雨燕双飞 提交于 2019-12-11 04:06:38
问题 I just upgraded to 1.9.1 After some technical defiificulties all work except: var $newthumbs = $(' <div id=\"car-7\" class=\"thumbnail_car thumbnail span2\" data-sorting-top=\"2\" data-sorting-date=\"2013-01-12 16:47:31 UTC\"></div>'); If I put this line in the console of jquery 1.8.3 it gets accepted and I can retrieve it with $newthumbs in 1.9.1 it fails with Error: Syntax error, unrecognized expression: I've read the changelog and I don't see anything relating that should break this. I may

How to replace “live” from jQuery 1.8.3 to jQuery 1.9? [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-09 16:23:55
问题 This question already has answers here : Turning live() into on() in jQuery (5 answers) Closed 6 years ago . My web framework automatically updated my jQuery script to the current last version, the 1.9. Now all my: $(".myclass").live("click", function() {... don't work anymore. I mostly used it with some ajax called which filled html in my page. I would know how to replace this functionnality in the last version. A friend told me to use "on" instead, but the "on" stays fixed on the same

jQuery 1.9 backward compatibility issue?

痴心易碎 提交于 2019-12-06 13:35:51
I am trying to use a jQuery plugin on my site which uses jQuery 1.6.2. When I change the jQuery version to 1.9 the plugin no longer works. I thought there was a backwards compatibility feature in jQuery. Is there any way to know/fix the code that does not work in 1.9? If it helps I am trying to use a plugin called CropZoom and here is the link. Also, let me know if there is similar plugin the same features. I'll appreciate it. Thanks This is How jQuery tell's you to fix it: We realize that existing sites and plugins may be affected by these changes, and are providing the jQuery Migrate plugin

What changed in jQuery 1.9 to cause a $.ajax call to fail with syntax error

ぃ、小莉子 提交于 2019-12-03 15:39:22
问题 I'm making a REST DELETE call, which returns a 204. In jQuery 1.8.3 this works, and hits the request.done callback. But if I use 1.9 it goes to request.fail with a parsererror in the textStatus and a 'SyntaxError: Unexpected end of input' in the errorThrown. remove = function (complete) { var self = this; var request = $.ajax({ context: self, url: "/v1/item/" + itemId, dataType: "json", type: "DELETE" }); request.done(removeCallback); request.fail(function (xhr, textStatus, errorThrown) {

jquery: How to get hh:mm:ss from date object? [duplicate]

蹲街弑〆低调 提交于 2019-12-03 15:08:20
问题 This question already has answers here : javascript date to string (6 answers) Closed 6 years ago . How can I get this hh:mm:ss from date object? var d = new Date(); // for now datetext = d.getHours()+":"+d.getMinutes()+":"+d.getSeconds(); I get this result below sometimes, 12:10:1 which should be 12:10:01 I assume this happens to the hour and minute as well. So I am after this 01:01:01 Not this 1:1:1 回答1: Solution - (tl;dr version) datetext = d.toTimeString().split(' ')[0] Explanation:

What changed in jQuery 1.9 to cause a $.ajax call to fail with syntax error

萝らか妹 提交于 2019-12-03 04:17:56
I'm making a REST DELETE call, which returns a 204. In jQuery 1.8.3 this works, and hits the request.done callback. But if I use 1.9 it goes to request.fail with a parsererror in the textStatus and a 'SyntaxError: Unexpected end of input' in the errorThrown. remove = function (complete) { var self = this; var request = $.ajax({ context: self, url: "/v1/item/" + itemId, dataType: "json", type: "DELETE" }); request.done(removeCallback); request.fail(function (xhr, textStatus, errorThrown) { alert(errorThrown); }); }, Anyone know what has changed in 1.9 that would cause this to fail, and what

Knockout 2.2.0 error with jQuery 1.9

99封情书 提交于 2019-11-30 23:12:04
问题 I copied one of examples of knockoutjs: <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/knockout/2.2.0/knockout-min.js"></script> <meta charset=utf-8 /> <title>JS Bin</title> </head> <body> <h2>Participants</h2> Here are the participants: <div data-bind="template: { name: 'person-template', data: buyer }"></div> <div data-bind="template: { name: 'person-template', data: seller }"></div> <script

jQuery 1.9.1 property selector

北城余情 提交于 2019-11-30 08:24:43
Background As of jQuery 1.9 the .attr(..) method no longer returns property values, instead we now have to use .prop(..) . Unfortunately this also applies to attributes specified via an attributes selector i.e. $("input[value=]") See http://jquery.com/upgrade-guide/1.9/#attr-versus-prop- and a good SO discussion on the differences between .attr and .prop : .prop() vs .attr() My Situation I'm currently using selectors like $("input[value=]") and $("select[value=]") to select input elements that have no value set. However, this no longer works with jQuery 1.9, instead I'm now doing something

jQuery 1.9.1 property selector

◇◆丶佛笑我妖孽 提交于 2019-11-29 11:37:02
问题 Background As of jQuery 1.9 the .attr(..) method no longer returns property values, instead we now have to use .prop(..) . Unfortunately this also applies to attributes specified via an attributes selector i.e. $("input[value=]") See http://jquery.com/upgrade-guide/1.9/#attr-versus-prop- and a good SO discussion on the differences between .attr and .prop : .prop() vs .attr() My Situation I'm currently using selectors like $("input[value=]") and $("select[value=]") to select input elements