projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PHP 8.2 More fixes. Deprecated dynamic member adds.
[fa-stable.git]
/
js
/
JsHttpRequest.js
diff --git
a/js/JsHttpRequest.js
b/js/JsHttpRequest.js
index d89ff4b2ce756a056af255d7826ba9ce903df857..1a1a2ec92e9df55aca11f3110b2b942e05fd41ab 100644
(file)
--- a/
js/JsHttpRequest.js
+++ b/
js/JsHttpRequest.js
@@
-3,7
+3,7
@@
*
* @license LGPL
* @author Dmitry Koterov, http://en.dklab.ru/lib/JsHttpRequest/
*
* @license LGPL
* @author Dmitry Koterov, http://en.dklab.ru/lib/JsHttpRequest/
- * @version 5.x
$Id$
+ * @version 5.x
*/
// {{{
*/
// {{{
@@
-192,6
+192,9
@@
function JsHttpRequest() {
status = 200;
statusText = "OK";
} else {
status = 200;
statusText = "OK";
} else {
+ // The special value "null" from a backend means Fatal error.
+ // User cannot assign null to $_RESULT manually, it is
+ // translated to false to avoid 500 error collisions.
status = 500;
statusText = "Internal Server Error";
}
status = 500;
statusText = "Internal Server Error";
}
@@
-255,7
+258,7
@@
function JsHttpRequest() {
if (tn == 'FORM') {
// FORM itself is passed.
formAdded = true;
if (tn == 'FORM') {
// FORM itself is passed.
formAdded = true;
- } else if (tn == 'INPUT' || tn == 'TEXTAREA' || tn == 'SELECT') {
+ } else if (tn == 'INPUT' || tn == 'TEXTAREA' || tn == 'SELECT'
|| tn == 'BUTTON'
) {
// This is a single form elemenent.
} else {
return this._error('inv_form_el', (v.name||''), v.tagName);
// This is a single form elemenent.
} else {
return this._error('inv_form_el', (v.name||''), v.tagName);
@@
-507,8
+510,10
@@
JsHttpRequest.LOADERS.xml = { loader: function(req) {
} catch (e) {}
if (!req.status) return;
try {
} catch (e) {}
if (!req.status) return;
try {
+ // Damned Opera returned empty responseText when Status is not 200.
+ var rtext = req.responseText || '{ js: null, text: null }';
// Prepare generator function & catch syntax errors on this stage.
// Prepare generator function & catch syntax errors on this stage.
- eval('JsHttpRequest._tmp = function(id) { var d = ' + r
eq.responseT
ext + '; d.id = id; JsHttpRequest.dataReady(d); }');
+ eval('JsHttpRequest._tmp = function(id) { var d = ' + r
t
ext + '; d.id = id; JsHttpRequest.dataReady(d); }');
} catch (e) {
// Note that FF 2.0 does not throw any error from onreadystatechange handler.
return req._error('js_invalid', req.responseText)
} catch (e) {
// Note that FF 2.0 does not throw any error from onreadystatechange handler.
return req._error('js_invalid', req.responseText)