Hi there peacemaker1820,

What exactly are you trying to do? There is an important distinction between what is happening client side i.e. Javascript, and what is happening inside a CGI application, which happens server side.

It could be that you are using ActiveState's perlscript and both Perl and Javascript are happening client side. But, I assume that your Perl is running server side.

Note, for Javascript to call a CGI application, it does this by invoking a new URL. This causes the browser to bring up a new page, without passing back a return value, because you are not returning into the Javascript.

One possibility though is to use frames. The new URL is loaded into a different target frame, and the new page for this frame contains some Javascript to call a function in your original frame to signify completion.

hth --rW


In reply to Re: Calling Perl function and script from javascript and backwards by rinceWind
in thread Calling Perl function and script from javascript and backwards by peacemaker1820

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.