I have a website where jQuery loads an application page in a div of that part of the index page.
The application page contains two DIVs. 1) the search form and 2) the result of the div.
A jQuery search loads the results in the results div. Each result has call-to-action buttons that load jQuery into the result div (leaving only the search bar). The user completes the call to action form, and then jQuery uploads the results to the results page.
This works great the first time, every time. However, if after loading the results page and the user again clicks on the search in the search bar, I get to the page where the user must select the call-to-action button, but a javascript error appears.
A common mistake for this:
TypeError: $('#cta-email').validate is not a function. (In '$('#cta-email').validate', '$('#cta-email').validate' is undefined)
This error then makes it impossible to click anything else based on javascript. Updating the page fixes it, but I cannot figure out what causes this script to cause errors when re-viewing it a second time.
Other notes. Almost every page loaded by jQuery has a <script>bottom. I researched material about scripts that do not start AJAX download, etc. Etc., But I'm not sure if this part of the problem is or not, because, as I said, I can go through the entire function once, but when going around, when errors occur.
If I do not have enough information to help solve this problem, let me know.