...
$text = $this->php2js($result);
}
// Content-type header.
// In XMLHttpRequest mode we must return text/plain - damned stupid Opera 8.0. :(
$ctype = !empty($this->_contentTypes[$this->LOADER])? $this->_contentTypes[$this->LOADER] : $this->_contentTypes[''];
header("Content-type: $ctype; charset=$encoding");
if ($this->LOADER != "xml") {
// In non-XML mode we cannot use plain JSON. So - wrap with JS function call.
// If top.JsHttpRequestGlobal is not defined, loading is aborted and
// iframe is removed, so - do not call dataReady().
$text = ""
. ($this->LOADER == "form"? 'top && top.JsHttpRequestGlobal && top.JsHttpRequestGlobal' : 'JsHttpRequest')
. ".dataReady(" . $text . ")\n"
. "";
if ($this->LOADER == "form") {
$text = '<script type="text/javascript" language="JavaScript"><!--' . "\n$text" . '//--></script>';
}
}
...