File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes JQuery .on(): Delegating to an enclosing DIV Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JQuery .on(): Delegating to an enclosing DIV" Watch "JQuery .on(): Delegating to an enclosing DIV" New topic
Author

JQuery .on(): Delegating to an enclosing DIV

K Mansoor
Ranch Hand

Joined: Jan 10, 2006
Posts: 52
Can a <DIV> element be used to delegate events bound to elements which will come into existence in the future?



Can I do something like this? please keep in mind at the execution of this code, the form and it's children (the button with id='some-button-id') does not exist.


This is not working for me, however, the following does work:


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

Should work. Please post an SSCCE (Short Self-Contained Correct Example)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
K Mansoor
Ranch Hand

Joined: Jan 10, 2006
Posts: 52
As I started to construct the example. The code started to work. Browser caching? not sure.
Thank you.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

If only all problems resolved themselves so easily!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JQuery .on(): Delegating to an enclosing DIV
 
Similar Threads
Need help with Jquery
Jack Up Browser Viewport
jQuery AJAX display issue
Can you post data from textfields to a URL without having a <form>
Is it possible to put a button inside autocomplete in jquery ui plugin?