1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-29 04:55:02 +03:00

Поддержка JSONP запросов

This commit is contained in:
Mzhelskiy Maxim 2010-10-31 10:05:37 +00:00
parent 84d42c5a35
commit 06c5580c75

View file

@ -359,6 +359,11 @@ class ModuleViewer extends Module {
header('Content-type: application/json');
}
echo json_encode($this->aVarsAjax);
} elseif ($sType=='jsonp') {
if (!headers_sent()) {
header('Content-type: application/json');
}
echo getRequest('jsonpCallback','callback').'('.json_encode($this->aVarsAjax).');';
}
exit();
}
@ -377,7 +382,10 @@ class ModuleViewer extends Module {
$JsHttpRequest = new JsHttpRequest("UTF-8");
}
}
$this->Security_ValidateSendForm();
// Для возможности кросс-доменных запросов
if ($sResponseAjax!='jsonp') {
$this->Security_ValidateSendForm();
}
$this->sResponseAjax=$sResponseAjax;
}
/**