Jump to content

Archived

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

tycheik85

Problem loading external javascript

Recommended Posts

I have a .js file stored in a folder named "lib". So to load it i use the following code:

[color=red]
<script language="javascript" src="lib/js_function.js" type="text/javascript"></script>
[/color]

it look correct but when i load the page i got a script error saying [b]";" expected[/b]  ???

No error is displayed when i change the code to the following:

[color=red]
<script language="javascript" src="lib/js_function.js;" type="text/javascript"></script>
[/color]

                                  OR

[color=red]
<script language="javascript" src="lib/js_function.js" type="text/javascript;"></script>
[/color]

But here is another problem. I can't call any function from js_function.js. Whenever i do that i'll get another error message "[b]object expected[/b]".

Does anyone face this problem before?

Share this post


Link to post
Share on other sites
The problem is not in the HTML linking the script, but in the script itself.

Share this post


Link to post
Share on other sites

×

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.