I’m building my first AJAX website where I implemented a custom MVC.
Basicly I’m sending with AJAX (via jQuery) the section to a big PHP switch which responds the part of the HTML/PHP page which is injected to the index page through AJAX.
My issue comes when, for instance, the response has a form wich I want to get with AJAX.
If I put my script to retrieve this form in my JavaScript file it does’nt work… but when I put my script in the same page that the html response it works and I’m thinking thats not a properly way to code… Am I wrong?
Is there anyway to gather all the JavaScript code in only one file?
Do you have PHP code in your JS file? If so, that is the problem, the JS file does not get parsed by PHP.