divinedesigns1 Posted May 31, 2014 Share Posted May 31, 2014 is there a way to add a php file or code within a javascript file? i believe you can do this with ajax but is it possible to be done in javascript? why i am asking is because i was to popular my javascript list with information within a database, both php and js are within a file. is there a way to do this without placing the code exactly onto the main page? Link to comment Share on other sites More sharing options...
davej Posted May 31, 2014 Share Posted May 31, 2014 You could have an HTML file, a JS file, and a Php file and then use Ajax. No code would be in the HTML file. Link to comment Share on other sites More sharing options...
thescientist Posted June 2, 2014 Share Posted June 2, 2014 Agree with DaveJ. Just use Javascript to make an Ajax request to get the data from a PHP script, and populate the dropdown dynamically. Link to comment Share on other sites More sharing options...
divinedesigns1 Posted June 6, 2014 Author Share Posted June 6, 2014 Agree with DaveJ. Just use Javascript to make an Ajax request to get the data from a PHP script, and populate the dropdown dynamically. ok thanks You could have an HTML file, a JS file, and a Php file and then use Ajax. No code would be in the HTML file. thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now