Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

running JavaScript from a browser not a server

Feb 9, 2012 7:23PM PST

Why is it best to run JavaScript from a browser rather than a server? Anyone have an examples why?

Discussion is locked

- Collapse -
Answer
Re: running javascript from a browser
Feb 9, 2012 7:27PM PST

The Javascript engine is built into the browser, and it works on the instantiated DOM (document object model) in the browser. That's why it's run in the browser.

Kees

- Collapse -
Why cant you run it off the server?
Feb 9, 2012 7:36PM PST

Why cant you run it off the server? Why is it best in a browser?

- Collapse -
The server doesn't speak Javascript.
Feb 10, 2012 2:27AM PST

So it can't run it.

Kees

- Collapse -
Why wouldn't you have it running off the sever?
Feb 9, 2012 7:37PM PST

Why wouldn't you have it running off the sever?

- Collapse -
For the simple reason
Feb 12, 2012 12:00PM PST

that you don't have to use your own resources. Your server can handle only so much work, so if you can delegate some of the work to the user's browser, and it doesn't impose a security issue, why not? Otherwise you would need a much more powerful server for per x amount of users.

~Sovereign