Originally Posted by felgall
Both provide a way to retrieve information from the server.
Both XHR2 and JSONP can retrieve from other domains - only the origiinal XHR has a same domain policy.
JSONP can only retrieve data in one specifiic format. XHR can retrieve in any format including XML and JSON and even plain text.
XHR can retrieve static XML files without requiring any server side processing.
XHR triggers an even when the data is returned and can then perform error handling - JSONP simply runs if it fis successfully retrieved and does nothing if the request fails.
Very well said. With this,I'm sure you'll know what to choose between the two. If you are to choose one!