javascript - Embedding inline JS script instead of making an AJAX request. Why? -
I did not send AJAX requests to load some websites (for example: apple.com or disqus.com) For example, live search results Instead they attach new JS scripts, which keep all the results in one variable.
To be more specific, if you go to apple.com and type "test" in the finder, it will not send an AJAX request to get the result, instead it & lt; Script src = "some.addres.apple.com/result.js?q=test"> Perform a new piece of HTML and JS script to bring search results to. Improvements are they doing just because you can not send AJAX requests to a different domain, or is there any speed improvement possible?
JSONP's "Hackinsoness" has many discussions:
I found it very useful to be around cross-domain security boundaries but I have not seen any speed improvement nor did I Have heard
I highly recommend knowing more about JSONP (especially when it is useful / required).
Comments
Post a Comment