javascript - Dynamic content and loading of JQuery scripts several times -
I have a page that loads content dynamically based on the menu item that the user clicks, different The tables are loaded dynamically and presented using jquery.
A column in each table is an updated link that is used to update the content that represents a specific line. When clicking on that link a JQuery UI model dialog is presented with a server-loaded form, in which the user must update the content and post back.
How do I understand that, please correct me if I am wrong I need to load jquery scripts at the same time because I want to bind events between javascript functions and loading elements Loading dynamic content for
Believing my assumption that I select the content and the same JQuery UI dialog script when the user selects a different table. I load the content and jquery files loaded with the main index file from various javascript functions.
The result can be estimated using unexpected behavior (possibly using the same case of use). Modal dialog is presented while loading the table more than once and updating some, then the dialog is not presented after the first or second use as an example.
Is this a problem that jquery scripts are loaded more than once? If this is the case, then I should use the principle or pattern for such an application. If there is any misconception above, still, what is the principle or pattern to design this kind of solution, where different types of dynamic materials are loaded in many places (all are presented in the same index file) and All need the same jquery files
If I understand you correctly, you are asking That events on dynamically-generated content How to bind You should be able to hook up content, in fact, ask new material to load as new content at the same time.
What you want is the handler you can specify the target of binding by using standard jQuery selectors. However, instead of the following syntax:
$ ('.foo'). Click (function () {}); You will use
$ ('.foo'). Live ('click', (function () {}); The way this works, that phenomenon happens through the blabber, where a child element (such as an input A box is placed on the box, in which all the 'bubbles' are done through the parent nodes. In this case, jQuery only looks for the entire document for event bubbles, and then it matches against your specific selector conditions .
Comments
Post a Comment