简体   繁体   中英

Calling external javascript file

Should the following display "Test" in a message box? If not, what changes should I make?

<html>
<base href="http://www.google.com"></base>
<body>
<script language="JavaScript" type="text/javascript" src="test.js"></script>
</body>
</html>

test.js contains:

alert("Test");

Yes. See here I've inserted this into a jsFiddle example. Next time try to just do it instead of asking a question. You can see the example here

alert("Test");

is the command that does a msg box!

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