Frage

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?

Keine korrekte Lösung

Andere Tipps

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top