By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,848 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,848 IT Pros & Developers. It's quick & easy.

On modperl

100+
P: 129
Hello friends,
Actually my doubt is we r using perl code in html but how to use same perl code in javascript? For example,
I am using one select box onchange i am calling a function and the corresponding values are in perl hash of arrays, so my problem is how to assign those hash of arrays values into another select box through javascript.
Apr 28 '08 #1
Share this Question
Share on Google+
2 Replies


Ganon11
Expert 2.5K+
P: 3,652
In my experience (which is very limited), Javascript is its own scripting language apart from Perl CGI. So you may want to stick with either Perl OR Javascript, but not both. It is fairly easy to create checkboxes and the like in Perl, and to change the contents of Perl values in this way.

Again, I have very little experience in this area, so I could be completely wrong.
Apr 28 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
You can't use perl code in html (you can but perlscript is so rarely used I doubt that is what you are doing). You can use perl to print html code, and use perl to print javascript just like you print html. But once the html/javascript is printed to a browser perl has no more communication with the html/javascript code. You have to send some data back to the perl script using a form to make changes to the page. You can use AJAX to do that or traditional CGI forms. Search for AJAX to read about what it is and how you can use it.
Apr 28 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.