mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 05:55:02 +03:00
Поддержка JSONP запросов
This commit is contained in:
parent
84d42c5a35
commit
06c5580c75
|
@ -359,6 +359,11 @@ class ModuleViewer extends Module {
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
}
|
}
|
||||||
echo json_encode($this->aVarsAjax);
|
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();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -377,7 +382,10 @@ class ModuleViewer extends Module {
|
||||||
$JsHttpRequest = new JsHttpRequest("UTF-8");
|
$JsHttpRequest = new JsHttpRequest("UTF-8");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->Security_ValidateSendForm();
|
// Для возможности кросс-доменных запросов
|
||||||
|
if ($sResponseAjax!='jsonp') {
|
||||||
|
$this->Security_ValidateSendForm();
|
||||||
|
}
|
||||||
$this->sResponseAjax=$sResponseAjax;
|
$this->sResponseAjax=$sResponseAjax;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue