Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Pass variable from Perl-AJAX-Perl Date: Thu, 22 May 2014 13:27:27 +0200 Organization: PointedEars Software (PES) Lines: 60 Message-ID: <2233284.cOHuCZCsUg@PointedEars.de> References: <7akfv.180209$6A3.141820@fx29.iad> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1400758051 20489 eJwFwYEBwCAIA7CXgEqd57Ru/H/CkgaTdy82V08PkCk7bsBuHB0zEd71iLoFyFNG6Q0R3w8XCBEp (22 May 2014 11:27:31 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Thu, 22 May 2014 11:27:31 +0000 (UTC) User-Agent: KNode/4.12.4 X-User-ID: eJwNysEBwCAIA8CVRCDIOJTI/iPUe58rBB0Gh/n4rE1flPsxsVxK6wZ7eDZUNVH+Ou9k43shhbvNEDXBlCM/V00VZA== Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. I start with an HTML page In most cases, there are no HTML pages. The concept of “pages” depends on a particular form of presentation; HTML does not (a fact often carelessly neglected by Web authors). > calling a Perl script to populate several select lists (title, author, > subject). You have server-side Perl generate an HTML document upon HTTP request, and the Web server to serve that document in an HTTP response to the client. > User then picks an option (say book title) which then needs to call > another Perl script to provide details of that choice. > > I am stuck trying to pass a variable (say the option choice) back to > AJAX so that I can use it to call the next Perl script. Only in a very broad sense of “call”. You can make an HTTP request from the client that causes the Web server to execute Perl, Perl to generate content, the Web server to serve that content in an HTTP response, and you can process that response on the client. > Is this something that is even possible with AJAX? Needless to say AJAX > is new to me. AJAX (Asynchronous JavaScript And XML) is not a technology; it is a common misnomer for a *technique* (XMLHttpRequest – XHR) to make HTTP requests and handle the resulting HTTP responses when the main Web document has been loaded. Saying to “pass something back to AJAX” or “call AJAX” makes as little sense as “pass something back to backtracking” or “call the refactoring”, for example. (You need to call an object’s methods to make those HTTP requests, but that is something else.) Knowing this now, you can answer your question. > I have an existing library running strictly on Perl > [http://www.softouch.on.ca/kb/kb.html] and thought I would try it using > AJAX. HTTP does not care how you generate transmitted content and mostly also not what the content is; neither does XHR. This is one reason why "AJAX" is a misnomer, as XML is almost always not involved anymore (JSON is the preferred format). The proper term, XMLHttpRequest, is the name of the implemented interface (originally only Microsoft’s IXMLHttpRequest), and is only accepted because it gives that reference, and for lack of a better term. See below and STFW (avoid w3schools.com, probably even jquery.com at this point – and of course all football-related sites). -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not Cc: me. / Bitte keine Kopien per E-Mail.