Jump to content


Photo

Problem loading external javascript


  • Please log in to reply
2 replies to this topic

#1 tycheik85

tycheik85
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 August 2006 - 08:34 AM

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


<script language="javascript" src="lib/js_function.js" type="text/javascript"></script>


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

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


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


                                  OR


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


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 "object expected".

Does anyone face this problem before?



#2 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 23 August 2006 - 09:01 AM

The problem is not in the HTML linking the script, but in the script itself.

#3 tycheik85

tycheik85
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 August 2006 - 09:40 AM

I've figured out the problem. Thanks for that remind.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users