themes/base: several IE related fixes in XHR class
This commit is contained in:
parent
dfc723af3e
commit
f3218c456a
1 changed files with 14 additions and 10 deletions
|
@ -56,6 +56,7 @@ XHR = function()
|
||||||
|
|
||||||
xhr.onreadystatechange = function()
|
xhr.onreadystatechange = function()
|
||||||
{
|
{
|
||||||
|
if( xhr.readyState == 4 ) {
|
||||||
var json = null;
|
var json = null;
|
||||||
if( xhr.getResponseHeader("Content-Type") == "application/json" ) {
|
if( xhr.getResponseHeader("Content-Type") == "application/json" ) {
|
||||||
try {
|
try {
|
||||||
|
@ -66,7 +67,6 @@ XHR = function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xhr.readyState == 4 ) {
|
|
||||||
callback( xhr, json );
|
callback( xhr, json );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,6 +144,9 @@ XHR = function()
|
||||||
|
|
||||||
this._encode = function(obj)
|
this._encode = function(obj)
|
||||||
{
|
{
|
||||||
|
obj = obj ? obj : { };
|
||||||
|
obj['_'] = Math.random();
|
||||||
|
|
||||||
if( typeof obj == 'object' )
|
if( typeof obj == 'object' )
|
||||||
{
|
{
|
||||||
var code = '';
|
var code = '';
|
||||||
|
@ -152,6 +155,7 @@ XHR = function()
|
||||||
for( var k in obj )
|
for( var k in obj )
|
||||||
code += ( code ? '&' : '' ) +
|
code += ( code ? '&' : '' ) +
|
||||||
k + '=' + encodeURIComponent( obj[k] );
|
k + '=' + encodeURIComponent( obj[k] );
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue