Questions tagged [jquery-1.7]

jQuery (version 1.7) is a fast, small, and feature-rich JavaScript library

jQuery version 1.7 was released on August 9th, 2012.

New features

Removed features

  • event.layerX and event.layerY
  • jQuery.isNaN()
  • jQuery.event.proxy()

See also the official homepage and the release notes.

76 questions
207
votes
5 answers

Turning live() into on() in jQuery

My application has dynamically added Dropdowns. The user can add as many as they need to. I was traditionally using jQuery's live() method to detect when one of these Dropdowns was change()ed: $('select[name^="income_type_"]').live('change',…
Jack
  • 9,133
  • 15
  • 64
  • 109
170
votes
17 answers

Getting Error "Form submission canceled because the form is not connected"

I have an old website with JQuery 1.7 which works correctly till two days ago. Suddenly some of my buttons do not work anymore and, after clicking on them, I get this warning in the console: Form submission canceled because the form is not…
Mahmoud Moravej
  • 8,035
  • 6
  • 40
  • 62
163
votes
3 answers

Check if any ancestor has a class using jQuery

Is there any way in jQuery to check if any parent, grand-parent, great-grand-parent has a class. I have a markup structure that has left me doing this sort of thing in the code: $(elem).parent().parent().parent().parent().hasClass('left') However,…
crmpicco
  • 14,513
  • 22
  • 113
  • 191
143
votes
6 answers

JQuery .on() method with multiple event handlers to one selector

Trying to figure out how to use the Jquery .on() method with a specific selector that has multiple events associated with it. I was previously using the .live() method, but not quite sure how to accomplish the same feat with .on(). Please see my…
butangphp
  • 1,453
  • 2
  • 10
  • 8
85
votes
8 answers

What's the difference between jQuery .live() and .on()

I see there's a new method .on() in jQuery 1.7 that replaces the .live() in earlier versions. I'm interested to know the difference between them and what the benefits are of using this new method.
ajbeaven
  • 8,509
  • 11
  • 74
  • 109
55
votes
3 answers

jQuery on() method on multiple selectors

Since version 1.7 live is deprecated. Following example is easy to make compatible with new on method: $('nav li, #sb-nav li, #help li').live('click', function () { // code... }); Using on: $('nav, #sb-nav, #help').on('click', 'li', function ()…
Wojciech Bednarski
  • 5,046
  • 8
  • 46
  • 71
41
votes
6 answers

When would I use JQuery.Callbacks?

I was looking through new stuff added to jQuery 1.7 and I saw they now have jQuery.Callbacks() http://api.jquery.com/jQuery.Callbacks/. The documentation shows you how to use jQuery.callbacks() but not any applicable examples of when I would want…
Keith.Abramo
  • 6,820
  • 2
  • 26
  • 43
38
votes
2 answers

jQuery on load of dynamic element

I'm trying to do some conditional manipulation of elements that are dynamically added to some container on a page, but I'm missing an event. Say I have a container:
I can easily bind an event handler to the click function…
Klaus Byskov Pedersen
  • 104,458
  • 27
  • 176
  • 219
21
votes
3 answers

jQuery 1.7 on() and off() methods for dynamic elements

jQuery 1.7's .on() and .off() methods are supposed to replace .live() and such. I tried it with a dynamic item: $(".myList").on('click', function(e){ alert('hello world'); }); This is not working for me for elements added after DOM is loaded.…
David
  • 325
  • 1
  • 3
  • 11
14
votes
1 answer

jQuery 1.7 is *still* returning the event.layerX and event.layerY error in Chrome

What am I doing wrong? Am I misunderstanding the problem or is it something else entirely? On my page I was using jQuery 1.6.4 from the Google CDN. This would, of course, generate the error: event.layerX and event.layerY are broken and deprecated…
Jack
  • 9,133
  • 15
  • 64
  • 109
12
votes
2 answers

jQuery get hash of element using .on() event

Before I get flamed with references to manuals, I have been researching this for quite some time, and keep getting dead ends. Not even sure how to debug it properly. So if any references are cited, please ensure they are well-commented and…
MaurerPower
  • 1,796
  • 5
  • 24
  • 46
9
votes
2 answers

jQuery 1.7: converting event shortcuts, such as click(), to on()?

I just found out that jQuery 1.7 introduced a new method, on(). With my brief study, I see it as a consolidated way to bind events, as opposed to decide which one of bind(), live(), and delegate() to use. IMO, this is a really nice addition that…
tamakisquare
  • 15,251
  • 24
  • 79
  • 125
6
votes
3 answers

jQuery 1.7 clientX/pageX undefined

I use jQuery and draggable from jqueryUI. When I update jQuery from 1.6 to 1.7 clientX and pageX attributes disappeared from event variable. Here is an example: http://jsbin.com/ezulas/7/edit If in given example jQuery version is changed to 1.6.4 -…
Thinker
  • 12,902
  • 8
  • 37
  • 52
5
votes
4 answers

jquery-ui datepicker with jquery .on() event

i'm using asual jquery-address, tabs example and want to add datepicker to the "Extra" tab. If i'm just adding $(document).ready(function() { $( "#datepicker" ).datepicker(); }); it wont work. So i found out i have to use .live(). As im using…
Felix
  • 75
  • 1
  • 1
  • 6
5
votes
5 answers

jQuery 1.7 .on() method, why is it necessary?

I don't understand why this method exists.... http://api.jquery.com/on/ It seems to me you'd always just do $(el).click() instead of $(el).on('click', function...
Webnet
  • 55,814
  • 100
  • 278
  • 454
1
2 3 4 5 6