I performed a number of searches but the search terms are very common and I was not able to find an answer to my question.

What are the disadvantages of testing ones Javascript by simply opening a local file in the browser over running a local server using, e.g DAMP, MAMP or WAMP?

没有正确的解决方案

其他提示

Generally speaking, it makes no difference where a Javascript file is served from. The Javascript code will be executed in exactly the same way, since the Javascript interpreter lives on the client-side.

The only difference would be when you are making ajax requests from your Javascript. Some browsers (chrome, firefox) prevent ajax calls to local files, even when the request is coming from a local file, though this can be disabled. When using a local server however, this would not be an issue, as the requests are treated like normal HTTP requests.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top