Skip to content

Commit 69a286c

Browse files
committed
Update JsUtilsAjaxTrait.php
1 parent 6d48470 commit 69a286c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Ajax/common/traits/JsUtilsAjaxTrait.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function _ajax($method, $url, $responseElement = '', $parameters = [])
3333
$retour = $this->_getAjaxUrl($url, $attr);
3434
$originalSelector = $responseElement;
3535
$responseElement = $this->_getResponseElement($responseElement);
36-
$retour .= "let self=this;\n";
36+
$retour .= "self=this;\n";
3737
$before = isset($before) ? $before : "";
3838
$retour .= $before;
3939
if ($hasLoader === true && JString::isNotNull($responseElement)) {
@@ -80,7 +80,6 @@ protected function _ajax($method, $url, $responseElement = '', $parameters = [])
8080
$retour .= '.always(function( dataOrjqXHR, textStatus, jqXHROrerrorThrown ) {' . ($always ?? '') . $this->removeLoader($hasLoader) . '})';
8181
$retour .= ";\n";
8282
$retour = $this->_addJsCondition($jsCondition, $retour);
83-
$retour='(function(){'.$retour.'})();';
8483
if ($immediatly) {
8584
$this->jquery_code_for_compile[] = $retour;
8685
}
@@ -126,7 +125,7 @@ protected function _addJsCondition($jsCondition, $jsSource) {
126125

127126
protected function _getAjaxUrl($url, $attr) {
128127
$url = $this->_correctAjaxUrl($url);
129-
$retour = "let url='" . $url . "';";
128+
$retour = "url='" . $url . "';";
130129
$slash = "/";
131130
if (JString::endswith($url, "/") === true) {
132131
$slash = "";

0 commit comments

Comments
 (0)