projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
dfc723a
)
themes/base: several IE related fixes in XHR class
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 18 Nov 2010 07:21:14 +0000
(07:21 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 18 Nov 2010 07:21:14 +0000
(07:21 +0000)
themes/base/htdocs/luci-static/resources/xhr.js
patch
|
blob
|
history
diff --git
a/themes/base/htdocs/luci-static/resources/xhr.js
b/themes/base/htdocs/luci-static/resources/xhr.js
index
9ce3026
..
3a30e04
100644
(file)
--- a/
themes/base/htdocs/luci-static/resources/xhr.js
+++ b/
themes/base/htdocs/luci-static/resources/xhr.js
@@
-56,17
+56,17
@@
XHR = function()
xhr.onreadystatechange = function()
{
xhr.onreadystatechange = function()
{
- var json = null;
- if( xhr.getResponseHeader("Content-Type") == "application/json" ) {
- try {
- json = eval('(' + xhr.responseText + ')');
- }
- catch(e) {
- json = null;
+ if( xhr.readyState == 4 ) {
+ var json = null;
+ if( xhr.getResponseHeader("Content-Type") == "application/json" ) {
+ try {
+ json = eval('(' + xhr.responseText + ')');
+ }
+ catch(e) {
+ json = null;
+ }
}
}
- }
- 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' )
{
var code = '';
if( typeof obj == 'object' )
{
var code = '';
@@
-152,6
+155,7
@@
XHR = function()
for( var k in obj )
code += ( code ? '&' : '' ) +
k + '=' + encodeURIComponent( obj[k] );
for( var k in obj )
code += ( code ? '&' : '' ) +
k + '=' + encodeURIComponent( obj[k] );
+
return code;
}
return code;
}