@@ -185,26 +185,26 @@ The ```close_command``` query string item should contain the command used to ini
185185The following JavaScript code demonstartes how to start an interactive Perl script immediately after its calling HTML page is loaded:
186186
187187``` javascript
188- document .addEventListener (" DOMContentLoaded" , function (event ) {
189- var request = new XMLHttpRequest ();
190- var parameters = {
191- target: " output" ,
192- close_command: " _close_" ,
193- close_confirmation: " _closed_"
194- }
195- request .open (' GET' , ' http://interactive@local-pseudodomain/perl/interactive-script.pl' +
196- formatParameters (parameters), true );
197- request .send ();
198- });
199-
200- function formatParameters (parameters ) {
201- return " ?" + Object
202- .keys (parameters)
203- .map (function (key ){
204- return key + " =" + parameters[key]
205- })
206- .join (" &" )
207- }
188+ document .addEventListener (" DOMContentLoaded" , function (event ) {
189+ var request = new XMLHttpRequest ();
190+ var parameters = {
191+ target: " output" ,
192+ close_command: " _close_" ,
193+ close_confirmation: " _closed_"
194+ }
195+ request .open (' GET' , ' http://interactive@local-pseudodomain/perl/interactive-script.pl' +
196+ formatParameters (parameters), true );
197+ request .send ();
198+ });
199+
200+ function formatParameters (parameters ) {
201+ return " ?" + Object
202+ .keys (parameters)
203+ .map (function (key ){
204+ return key + " =" + parameters[key]
205+ })
206+ .join (" &" )
207+ }
208208```
209209
210210## AJAX Perl Scripts
@@ -213,18 +213,18 @@ Local AJAX Perl scripts executed by PEB must have the pseudo-user ```ajax``` in
213213The following example based on [ jQuery] ( https://jquery.com/ ) calls a local AJAX Perl script and inserts its output into the ``` ajax-results ``` HTML DOM element of the calling page:
214214
215215``` javascript
216- $ (document ).ready (function () {
217- $ (' #ajax-button' ).click (function () {
218- $ .ajax ({
219- url: ' http://ajax@local-pseudodomain/perl/ajax-test.pl' ,
220- method: ' GET' ,
221- dataType: ' text' ,
222- success : function (data ) {
223- $ (' #ajax-results' ).html (data);
224- }
225- });
226- });
227- });
216+ $ (document ).ready (function () {
217+ $ (' #ajax-button' ).click (function () {
218+ $ .ajax ({
219+ url: ' http://ajax@local-pseudodomain/perl/ajax-test.pl' ,
220+ method: ' GET' ,
221+ dataType: ' text' ,
222+ success : function (data ) {
223+ $ (' #ajax-results' ).html (data);
224+ }
225+ });
226+ });
227+ });
228228```
229229
230230## Linux Superuser Perl Scripts
0 commit comments