views:

25

answers:

2

Hi,

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" >

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.

A: 

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.

Desintegr
Exception to javascript execution on the client side is server-side javascript ;)
Residuum
+2  A: 

Client side, and yes - respectively.

Ofir