开发者

why my javascript file doesn't load in my page?

There is a script file that I wrote. I included it to my page at the top of codes in head tag after 3 other scripts. The others works as well but the last one that I said, never gonna be load into the page. I had same problem like this many times ago but I cant remember how I fixed it.

Here's the question for me. Why others works, but this script not. And of course when I went to the Browser View Source at runtime and I clicked on this script link it gave me this error:

Not Found

The requested URL /dreamfactory/mainsite/scripts/bbcodeeditor.js was not found on this server

I'm running on localhost and all scripts are in the scripts folder. Like jQuery, and a Main script. (There is no conflict).

UPDATE

Sorry for bringing up this question but I should write something that might be helpful to a reader some day. If you've linked your file in the page and it's not getting loaded, the number 1 reason is that you have an error in that script file. For detecting your script you can run developers tool(like Firefox's Web Console) provided in browsers and go to the Console tab to see what line is causi开发者_高级运维ng the problem. Be sure to check your file with one or two browsers. I saw that the Firebug does not warn about the syntax(e. g. defining a default parameter ..., arg = '') in javascript which is wrong thing) in your script file so I used FF, IE or Chrome developers tool for example.


So there is nothing wrong with the way you've included the script on your page. The error message says it all: the script is not being found by your server. Check:

  • The script is there on the filesystem
  • Script name is correct
  • That the path and filename have the correct capitalisations (upper, lower casing)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜