samedi 7 juin 2014

Load / Include Javascript Files in PHP


Vote count:

0




Hello i would like to know how i can include individual javascript files on their respective pages in PHP. I have seperated my template into header.php, sidebar.php, index.php and footer.php, right now i have all the javascript in one file: global.js which i load in the footer section. ' I have a chat in my application which i load also in my but because of that whenever you are on any other page apart from the chat page the script generates errors, because it cannot find the specified elements.


If i have a page like contact.html, i would like to know how i can load the javascript unique only to that page eg. contact.js without having to just dump it in the footer section and have it loaded whether or not you're on the contact page.



asked 40 secs ago






Aucun commentaire:

Enregistrer un commentaire