javascript - Can an Ajax function birth another Ajax function? -
i have .live ajax function (let's call x) executes onclick , connects database url: myphpvalues.php.
inside php have added ajax .live function (let's call y) output once user clicks first ajax link.
is allowed?
first, .live
has nothing ajax. allows trap user event (click, hover, etc) on controls not yet exist in dom. if using version of jquery later 1.7, .live
has been replaced .on
(essentially same syntax). if little foggy, please read this. basically, if didn't use .on()
jquery code not bind clicked element because element didn't exist when binding attempted.
also, if little foggy on ajax, please review this before continuing.
because ajax allows javascript routine request/receive data back-end (php) file, there no need use ajax within back-end file -- it's php (or asp.net or whatever) , can include
(or whatever) routines other php files.
however, if asking if can return new javascript/jquery code originating html/js page, yes can. can send html/js/css code like.
and can new code include ajax code block? yes can. give try! need use .on()
again, though.
Comments
Post a Comment