File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -115,23 +115,27 @@ protected function useJquery()
115115 */
116116 protected function constructAjaxCall ()
117117 {
118+ $ ajaxLink = $ this ->ajaxLink ;
119+ $ containerId = $ this ->getContainerId ();
120+ $ data = $ this ->produceJavascriptData ();
121+
118122 if ($ this ->useJquery ()) {
119123 $ id = WidgetId::get ();
120124
121125 return
122126 "var widgetTimer {$ id } = setInterval(function() { " .
123127 'if (window.$) { ' .
124- "$('# {$ this -> getContainerId () }').load(' " .$ this -> ajaxLink ."', {$ this -> produceJavascriptData () }); " .
128+ "$('# {$ containerId }').load(' " .$ ajaxLink ."', {$ data }); " .
125129 "clearInterval(widgetTimer {$ id }); " .
126130 '} ' .
127131 '}, 100); ' ;
128132 }
129133
130134 return
131135 'var xhr = new XMLHttpRequest(); ' .
132- 'var params = ' .$ this -> produceJavascriptData () .'; ' .
133- 'var container = document.getElementById(" ' .$ this -> getContainerId () .'"); ' .
134- 'xhr.open("POST", " ' .$ this -> ajaxLink .'", true); ' .
136+ 'var params = ' .$ data .'; ' .
137+ 'var container = document.getElementById(" ' .$ containerId .'"); ' .
138+ 'xhr.open("POST", " ' .$ ajaxLink .'", true); ' .
135139 'xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); ' .
136140 'xhr.send(params); ' .
137141 'xhr.onreadystatechange = function() { ' .
You can’t perform that action at this time.
0 commit comments