Code Comments
Programming Forum and web based access to our favorite programming groups.Hi everybody i got a program that works in a bash environment, and now, i would like to make a cgi with it, the objective for this program is check the integrity of the info provided by some text files and if it finds some error ask you for some info and i would like to be able to introduce it. To solve it i was thinking on introduce a javascript code into my cgi, but i don't know how to pass the variable info between perl and javascript. could any of you tell me how to do it or give me any idea or give me a solution of how do it? thanks pau -- Pau Marc Muñoz Torres Laboratori de Biologia Computacional Institut de Biotecnologia i Biomedicina Vicent Villar Universitat Autonoma de Barcelona E-08193 Bellaterra (Barcelona) telèfon: 93 5812807 Email : paumarc.munoz@bioinf.uab.cat
Post Follow-up to this messageOn Fri, 2008-03-14 at 15:14 +0100, Pau Marc Munoz Torres wrote: > To solve it i was thinking on introduce a javascript code into my cgi, but i > don't know how to pass the variable info between perl and javascript. AJAX - I ended up hand coding my AJAX from scratch but there is a module that I have not tried yet CGI::AJAX, http://search.cpan.org
Post Follow-up to this messageHi is There some easy-understanding "how to use ajax with perl" tutorial somewhere? i just need to know how to do a cgi script to launch a prompt (javascript) and use the answer in my script please help!! pau -- Pau Marc Muñoz Torres Laboratori de Biologia Computacional Institut de Biotecnologia i Biomedicina Vicent Villar Universitat Autonoma de Barcelona E-08193 Bellaterra (Barcelona) telèfon: 93 5812807 Email : paumarc.munoz@bioinf.uab.cat
Post Follow-up to this messageI haven't learned AJAX yet (hopefully this summer), but I don't think you can do it exactly as you have envisioned. The CGI/Perl script runs on the server and produces some static HTML code which contains the AJAX. The script finishes. The HTML is sent to the browser. The browser then renders the HTML and runs any JavaScript it finds. At this point, you can prompt the user for input. (Or use plain HTML without JS and just have an HTML form.) If you are using AJAX, you can now have the JS sent the input to the server and call the script with the data. The script can generate some output that the JS would add to the webpage. The script itself can not directly ask for input.
Post Follow-up to this messageOn Wed, 2008-04-02 at 17:19 +0200, Pau Marc Munoz Torres wrote: > Hi > > is There some easy-understanding "how to use ajax with perl" tutorial > somewhere? > > i just need to know how to do a cgi script to launch a prompt (javascript) > and use the answer in my script I learnt AJAX from Mastering Ajax tutorial in developerworks http://www.ibm.com/developerworks/l...ajaxintro1.html There is also a module cgi::ajax in CPAN that you might want to look at. -- Ken Foskey FOSS developer
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.