in reply to Calling a perl function from within a javascript function

Short answer: Write a Java applet if you want something to work like that. You can send XML from your Perl script to the Java program, which could presumably display it. This isn't easy though. It sounds like the Golden Hammer of solutions, in other words, a waste of time.

Long answer: Make a bigger map and label it so that it makes sense as to what people are looking at. Also, you can easily generate JavaScript code from within Perl. With that in mind, you can export a JavaScript array which would have coordinates and town names. You can't "call" Perl from within JavaScript, because there is no Perl. There is only a Web server somewhere, with Perl running on it.

As long as the page you're talking about can be converted into a Perl-generated one, then you have a lot of ways you can go about solving this problem.
  • Comment on Re: Calling a perl function from within a javascript function

Replies are listed 'Best First'.
Re: Re: Calling a perl function from within a javascript function
by Baz (Friar) on Jun 26, 2002 at 00:26 UTC
    My map fits the vertical length of the screen already, and thers about 100 sectors so theres no room on it for text. I'm using gd.pm to shade the map.

    I dont understand what you mean by "there is no Perl". Is there not a JavaScript equivalent of perls get function. If there was, I could have the perl script print out the town names, and this would be received by the JavaScript equivalent of get().

    Maybe I'm missing something here, I started Internet based programming less than a year ago so my knowledge is patchy to say the least.
      In that perfect world where we all live together in perfect harmony, the sky is always blue, the grass is always green, and VB never came into being, yes, there is a JavaScript get() function.

      In the really real world, though, such a thing would be considered a munition. Your browser could be commanded by a third-party to do whatever they choose, such as probe sites with IIS attacks, send files from your computer, or just cause general mayhem (i.e. DDOS).

      There is no "get()" function, no.

      With a little creativity, though, you can swap images in a clever way to simulate animation and/or server-side loads. Check your JavaScript reference on how to do this, because this is clearly not a Perl question at this point.
    A reply falls below the community's threshold of quality. You may see it by logging in.