Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling javascript function

Status
Not open for further replies.

gregaug

Programmer
Joined
Sep 9, 2005
Messages
61
Location
US
I know this may sound dumb, but how do I force perl to call a javascript function everytime it reaches a certain point in the code?
 
hmmm.... I don't think you can. Can you explain better what you're doing?

Perl prints javascript out to the browser, but it can't call javascript functions per se. You have to initiate javascript functions from within the browser using events, such as onload or submit.

Or maybe someone knows something I am not aware of.
 
as Kevin states, javascript means nothing to Perl. You can use Perl to write javascript - but only a browser will understand it. Maybe i too am missing the point...

Kind Regards
Duncan
 
I'm parsing thru a file to get names to be put in a drop down. I then want to sort that drop down. I have a javascript function that can sort it, since the list of names is not permanently stored. I think I might need to just use an OnLoad to call my javascript. Thanks for your help.
 
sounds like you can do all that in perl before printing out the html code, unless you need to have it done in the browser by javascript for some reason.
 
Again, i am with Kevin

Keep adding elements to an array - for example - sort the array and write out the javascript. Easy!

Kind Regards
Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top