html - JQuery $(document).ready ajax load -
I looked at some of the related questions and I should ask this completely different as I saw only a few related to do. I am loading a whole central div through JQuery Ajax call and I just want to be able to do some automated JQuery on new areas like $ (document). When a DOM is loading I have read that the lyquiery will do this, but I thought it would be made in a way. I'm trying to add an input picture from the beginning to an input field.
This is the content that will call for content in the backend and then pulls some specific sections.
$ Post ("ReportingWizard", $ ("# wizard_form"). Serialize (), function (data) {setData (data);}); Function set data (data) {divElement.innerHTML = data; $ (ActiveTab) .fadeIn (); // Active content fade in $ (". WizardBody") FadeIn (); }
There is a JQuery method inside the file being inserted on that divion for which it needs to run to replace html inside
< Div class = "post-text" itemprop = "text">
Register the event in the callback of ajax function.
If you are using .load ()
to load mid div , then place your jack code directly in the callback:
$ ('# middleDiv') Load ('/ fish.php', function () {$ ('# someDiv'). FadeIn (300); //?);
If you are using some other AJAX functions, then place your jQuery code after the line where you add an element to the DOM in the callback:
jQuery.get ('/ fish.php', function (response) {$ ('# middleDiv') .html (feedback); $ ('# someDiv'). FadeIn (300); //?}} };
If this is the event that you want to bind, you can also consider using it (or. Or if you are using earlier versions of jQuery , Which is the value of this question
These methods allow the compulsive elements of events even when they are not present in the DOM, which means That you can tie events in your $ (document) .ready ()
blocks, even if the elements are not yet registered in the DOM.
Comments
Post a Comment