简体   繁体   中英

Calling External Scripts in JavaScript

I tried calling a external javascript script using this format, but nothing appeared in my browser (both IE & Firefox):

<script type="text/javascript" src="projectABC.js"></script>

Why is nothing appearing?

Make sure that projectABC.js exists in the place the client will look for, or define "rules" on your webserver. You can look at the definite path of the .js-file using a developer-tool, such as firebug.

Furthermore, you don't have to declare type (anymore).

Or do you mean not even the script-tag appears? If so, have you already tried to clear the cache?

Make sure that the script file that is called must exists in the same directory of the project, other wise use the absolute path to define the location. or if the file is called from outer source then the complete url like http:\\... defining the location must be specified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM