I have a .live Ajax function (let's call this x) which executes onclick and connects to the database with a
Inside this php I have added another Ajax .live function (let's call this y) to be output once the user clicks the first Ajax link.
Is this allowed?
.live has nothing to do with AJAX. It allows us to trap a user event (click, hover, etc) on controls that do not yet exist in the DOM. If you are using a version of jQuery later than 1.7, then
.live has been replaced with
.on (essentially the same syntax). If a little foggy, please read this. Basically, if you didn't use
.on() the jQuery code would not bind to the clicked element because the element didn't exist when the binding was attempted.
Also, if you are a little foggy on AJAX, please review this before continuing.
include (or whatever) routines from other PHP files.
And can this new code include another AJAX code block? Yes it can. Give it a try! You will probably need to use
.on() again, though.