Jump to content

Problem loading external javascript


tycheik85

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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