jquery-1.4

jQuery: running success in 1.3.2 but not in 1.4.2

笑着哭i 提交于 2020-01-07 04:52:13
问题 Nothing is wrong, as soon as i change the lib to 1.3.2 my on success stuff works just fine? How comes? Not even the alert with TEST appears.. Here's the code this is happening on: function crop() { $.ajax({ type: "POST", dataType: 'json', url:"functions.php?action=crop", data: { x: $('#x').val(),y: $('#y').val(),w: $('#w').val(), h: $('#h').val(),fname:$('#fname').val(),fixed:fixed, sizew:sizew,sizeh:sizeh}, success: function(response) { alert('TEST'); if(!fixed) // Missing { } { $("

jQuery: running success in 1.3.2 but not in 1.4.2

a 夏天 提交于 2020-01-07 04:52:08
问题 Nothing is wrong, as soon as i change the lib to 1.3.2 my on success stuff works just fine? How comes? Not even the alert with TEST appears.. Here's the code this is happening on: function crop() { $.ajax({ type: "POST", dataType: 'json', url:"functions.php?action=crop", data: { x: $('#x').val(),y: $('#y').val(),w: $('#w').val(), h: $('#h').val(),fname:$('#fname').val(),fixed:fixed, sizew:sizew,sizeh:sizeh}, success: function(response) { alert('TEST'); if(!fixed) // Missing { } { $("

Using an equivalent of $.when().done() in jQuery 1.4

蹲街弑〆低调 提交于 2019-12-31 01:26:30
问题 I need to do two different JSON requests and combine those requests in one function. I would have liked to use the following construction: $.when( $.getJSON(url1), $.getJSON(url2) ).done(function(data1, data2) { someFunction(data1, data2); }); Unfortunately, for this project we are using jQuery 1.4 and $.when was introduced since jQuery 1.5. Is there some equivalent for this in jQuery 1.4? Thanks in advance! 回答1: To implement this functionality, I have done an array where each element is a

Custom validator fires but does not prevent postback

冷暖自知 提交于 2019-12-22 05:48:16
问题 I've seen a lot of questions about this already, but I'm stumped! Please help! I have a customvalidator. It's firing but it's not preventing postback. Please help me in doing so! I can see that console.log registers before the post. But, it posts back anyway. How do I prevent the postback? I've tried adding a control to validate, and validate empty text equal to true. I also tried adding e.preventdefault, which did not work :( How can I prevent the postback? <script type="text/javascript"> //

jquery live hover

六眼飞鱼酱① 提交于 2019-12-17 04:13:21
问题 I'm using the following jquery code to show a contextual delete button only for table rows we are hovering with our mouse. This works but not for rows that have been added with js/ajax on the fly... Is there a way to make this work with live events? $("table tr").hover( function () {}, function () {} ); 回答1: jQuery 1.4.1 now supports "hover" for live() events, but only with one event handler function: $("table tr").live("hover", function () { }); Alternatively, you can provide two functions,

live change handlers in jQuery 1.4 don't work for select elements in IE

混江龙づ霸主 提交于 2019-12-13 03:50:52
问题 I recently decided to try jQuery 1.4, excited that I would finally have support for live event handlers that work for change events in IE. However, it seems like they don't always work. If I try to assign a live change handler on a select element, it doesn't work when I change it in IE. I tried this in IE 6, 7, and 8. In every other browser I tried (Firefox, Chrome, Safari), it works fine. I tried putting the command to assign the handler within the ready function, and that didn't fix it.

Jquery after ie8/ie7 not working

可紊 提交于 2019-12-12 17:30:05
问题 I'm trying to insert data after an existing DOM element. I'm getting an error "Invalid argument." -- this.parentNode.insertBefore This is not working in IE8 or IE7. Ideas? Jfiddle example: http://jsfiddle.net/zJ3Fe/ <a href="#" id="delete_promo">Click</a> <div id="customer-info" class="span-12"> <form id="UserFormCheckoutForm" method="post" action="/chicagophotographycenter/checkout" accept-charset="utf-8"><div style="display:none;"><input type="hidden" name="_method" value="POST" /></div>

.attr('checked', 'checked') / .attr('checked', 'true') not adding attribute in html

白昼怎懂夜的黑 提交于 2019-12-10 11:58:22
问题 This is my JavaScript, using jQuery: $("#E_DIV_H input[value='E,F']").attr('checked', 'checked'); var data = $('#E_DIV_H').html(); $('#copy').html(data); When it copies the data from one <div> ( #E_DIV_H ) to another DIV ( #copy ), it unchecks the check box, which should already be checked due to the following code! $("#E_DIV_H input[value='E,F']").attr('checked', 'checked'); Using Firebug, I see that .attr('checked', 'checked') is checking the check box without adding the attribute. Is there

jQuery 1.4.2 Using .delegate() on a change event for a doropdown list

社会主义新天地 提交于 2019-12-08 03:46:57
问题 My problem is that I am not sure how to use .delegate for the following scenario: our application has a voting system to which several rounds or steps can be added. every time a new step is added there is a list of options that defines how the round/step is to be won. <select class="listOfOptions"> <option value="U">Unanimous</option> <option value="M">Majority</option> <option value="C" class="customOption"># of votes…</option> </select> now when an option is selected the following code runs

jqDnR plugin doesn't work with jQuery 1.4

↘锁芯ラ 提交于 2019-12-07 09:25:12
问题 I am using jqModal plugin which relies on jqDnR for drag and resize support. After I upgraded jQuery to 1.4, modal boxes stopped responding to "drag" event. Does anyone know why this is happening? Thanks.. 回答1: Using the version downloaded directly from the author's website (here), on lines 19, character 38 and 27, character 23. Replace $() with $(document) That's how I got jqDnR to work with 1.4 回答2: see the jQuery 1.4 release announcement - Backwards-Incompatible Changes. We’ve also written