문제

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