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.
精彩评论