1

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.

2 Answers 2

2

Client side, and yes - respectively.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

Exception to javascript execution on the client side is server-side javascript ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.