Jump to content

Extrenally include JS and page shows blank


cs.punk

Recommended Posts

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...

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.