开发者

HTML script element localhost uri

This may seem like a silly question, but consider the following use of the 'script' element to import an external javascript file:

<script src="http://localhost:8085/myscript.js" type="text/javascript" &开发者_Python百科gt;

Given that this is a url and not a file path, would this be evaluated server side or client side?

If evaluated client side, then it would fail as the script resides on the server, not the 'localhost' of the client?

Thanks.


Client side, and yes - respectively.


The myscript.js file is downloaded from the server (localhost:8085) then executed by the browser on the client-side.

Javascript is always executed on the client-side.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜