cs.punk Posted February 24, 2011 Share Posted February 24, 2011 Urggggh what am I doing wrong? <script type="text/javascript" src="js.js" /> js.js just conatins alert("hello"); When I don't include it, everythings fine, but as soon as I add that boom my page goes blank. I have tried DOM inspector in FireFox and it seems it's not getting anything from the body element... Thank you... Link to comment https://forums.phpfreaks.com/topic/228697-extrenally-include-js-and-page-shows-blank/ Share on other sites More sharing options...
sunfighter Posted February 25, 2011 Share Posted February 25, 2011 You load external scripts with an include or a require. LIke this <?php require (js.js'); ?> OR like what your doing: <script type="text/javascript" src="javasct.js"></script> The corrected version with the </script> tag. When done this way the script your calling can not have the <script> tags. Link to comment https://forums.phpfreaks.com/topic/228697-extrenally-include-js-and-page-shows-blank/#findComment-1179369 Share on other sites More sharing options...
cs.punk Posted February 25, 2011 Author Share Posted February 25, 2011 I'll give it a try! Link to comment https://forums.phpfreaks.com/topic/228697-extrenally-include-js-and-page-shows-blank/#findComment-1179448 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.