API2 Tester
svn path=/Website/trunk/; revision=24174
This commit is contained in:
@@ -8,7 +8,7 @@ ANONYMOUS_Allowed = 1;
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<script src="jquery-1.9.1.js"></script>
|
||||
<script src="jquery-1.11.0.min.js"></script>
|
||||
<script src="tester.js"></script>
|
||||
<script src="jquery.iecors.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<script src="jquery-1.9.1.js"></script>
|
||||
<script src="jquery-1.11.0.min.js"></script>
|
||||
<script src="tester.js"></script>
|
||||
<script src="jquery.iecors.js"></script>
|
||||
<script>
|
||||
|
||||
46
APPL/API2/TESTER/jquery.iecors.js
Normal file
46
APPL/API2/TESTER/jquery.iecors.js
Normal file
@@ -0,0 +1,46 @@
|
||||
(function( jQuery ) {
|
||||
// Create the request object
|
||||
// (This is still attached to ajaxSettings for backward compatibility)
|
||||
jQuery.ajaxSettings.xdr = function() {
|
||||
return (window.XDomainRequest ? new window.XDomainRequest() : null);
|
||||
};
|
||||
|
||||
// Determine support properties
|
||||
(function( xdr ) {
|
||||
jQuery.extend( jQuery.support, { iecors: !!xdr });
|
||||
})( jQuery.ajaxSettings.xdr() );
|
||||
|
||||
// Create transport if the browser can provide an xdr
|
||||
if ( jQuery.support.iecors ) {
|
||||
|
||||
jQuery.ajaxTransport(function( s ) {
|
||||
var callback,
|
||||
xdr = s.xdr();
|
||||
|
||||
return {
|
||||
send: function( headers, complete ) {
|
||||
xdr.onload = function() {
|
||||
var headers = { 'Content-Type': xdr.contentType };
|
||||
complete(200, 'OK', { text: xdr.responseText }, headers);
|
||||
};
|
||||
|
||||
// Apply custom fields if provided
|
||||
if ( s.xhrFields ) {
|
||||
xhr.onerror = s.xhrFields.error;
|
||||
xhr.ontimeout = s.xhrFields.timeout;
|
||||
}
|
||||
|
||||
xdr.open( s.type, s.url );
|
||||
|
||||
// XDR has no method for setting headers O_o
|
||||
|
||||
xdr.send( ( s.hasContent && s.data ) || null );
|
||||
},
|
||||
|
||||
abort: function() {
|
||||
xdr.abort();
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
})( jQuery );
|
||||
Reference in New Issue
Block a user