Jquery, jsonp, error handling and security issues

in jquery 1.3.2

for jsonp requests i used for this

var _options = {
        url: 'someexternal_url',
        type: 'GET',
        dataType: 'jsonp',
        success:_aSucFnToHandle,
        error: _anErrFnToHandle
    };

    $.ajax(_options);// this ignores any error if occurs on url

so i added below script and changed my ajax request

<script type="text/javascript" 
     src="http://jquery-jsonp.googlecode.com/files/jquery.jsonp-1.0.4.min.js">
</script>

$.jsonp(_options); // with this i can handle error if any occurs on url

My questions:

  • Are there any improvements in jQuery 1.4.2 for handling errors in a jsonp request or how to handle u the error that occurs when creating a jsonp request
  • list of hole security cycles in jsonp request
+3
source share
2 answers

Pro # 1: Not yet, but you should review http://code.google.com/p/jquery-jsonp/ , because it is up to version 2.1.x now;)

№ 2, , , javascript ( ). , JSONP. , , .

+4

JavaScript. : Dom Based XSS Client Side Trust. , , javascript, , , , TamperData GreaseMonkey.

0

Source: https://habr.com/ru/post/1753276/


All Articles