Running Perl Scripts

Discussion in 'Javascript' started by Hal Vaughan, Jan 22, 2004.

  1. Hal Vaughan

    Hal Vaughan Guest

    Is there a way to run a Perl script WITHOUT submitting a form? I want to be
    able to click an "update" button on a page and have it run a Perl script to
    update info, without changing the document in the browser. Is there any
    way to do that and leave the current page intact in the browser?

    Thanks!

    Hal
    Hal Vaughan, Jan 22, 2004
    #1
    1. Advertising

  2. Hal Vaughan

    Randy Webb Guest

    Hal Vaughan wrote:
    > Is there a way to run a Perl script WITHOUT submitting a form? I want to be
    > able to click an "update" button on a page and have it run a Perl script to
    > update info, without changing the document in the browser. Is there any
    > way to do that and leave the current page intact in the browser?
    >


    Change the source of an image to point to your Perl script. When its
    requested from the server, it executes the script. Either hide the image
    or have the perl script return a harmless image.

    --
    Randy
    Chance Favors The Prepared Mind
    Randy Webb, Jan 22, 2004
    #2
    1. Advertising

  3. Randy Webb wrote:

    > Hal Vaughan wrote:
    >
    >> Is there a way to run a Perl script WITHOUT submitting a form? I want
    >> to be
    >> able to click an "update" button on a page and have it run a Perl
    >> script to
    >> update info, without changing the document in the browser. Is there any
    >> way to do that and leave the current page intact in the browser?
    >>

    >
    > Change the source of an image to point to your Perl script. When its
    > requested from the server, it executes the script. Either hide the image
    > or have the perl script return a harmless image.
    >


    That is a cute way to do it... you can hide the image in a div with
    visibilty turned off... I like it.

    My idea is to hav a small (1x1) IFRAME that changes source.

    Brian
    Brian Genisio, Jan 22, 2004
    #3
  4. Hal Vaughan

    Randy Webb Guest

    Brian Genisio wrote:

    > Randy Webb wrote:
    >
    >> Hal Vaughan wrote:
    >>
    >>> Is there a way to run a Perl script WITHOUT submitting a form? I
    >>> want to be
    >>> able to click an "update" button on a page and have it run a Perl
    >>> script to
    >>> update info, without changing the document in the browser. Is there any
    >>> way to do that and leave the current page intact in the browser?
    >>>

    >>
    >> Change the source of an image to point to your Perl script. When its
    >> requested from the server, it executes the script. Either hide the
    >> image or have the perl script return a harmless image.
    >>

    >
    > That is a cute way to do it... you can hide the image in a div with
    > visibilty turned off... I like it.
    >
    > My idea is to hav a small (1x1) IFRAME that changes source.


    That works, in browsers that support IFrames (Its the NN4.xx in me
    coming out). Hence my suggestion for the images. Image swapping has to
    be more widely supported than IFrames.

    --
    Randy
    Chance Favors The Prepared Mind
    Randy Webb, Jan 22, 2004
    #4
  5. Hal Vaughan wrote:

    > Is there a way to run a Perl script WITHOUT submitting a form? I want to be
    > able to click an "update" button on a page and have it run a Perl script to
    > update info, without changing the document in the browser. Is there any
    > way to do that and leave the current page intact in the browser?


    Let your Perl script return the HTTP response code 204 and the browser
    shouldn't change anything, no need for scripting.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 22, 2004
    #5
  6. Hal Vaughan

    Hal Vaughan Guest

    Martin Honnen wrote:

    >
    >
    > Hal Vaughan wrote:
    >
    >> Is there a way to run a Perl script WITHOUT submitting a form? I want to
    >> be able to click an "update" button on a page and have it run a Perl
    >> script to
    >> update info, without changing the document in the browser. Is there any
    >> way to do that and leave the current page intact in the browser?

    >
    > Let your Perl script return the HTTP response code 204 and the browser
    > shouldn't change anything, no need for scripting.
    >


    What kind of header goes on that? Do I use the HTML "Content-type:
    text/html" header before sending it? (Obviously I've never used error
    codes before.)

    Hal
    Hal Vaughan, Jan 22, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lisa
    Replies:
    19
    Views:
    246
    A. Sinan Unur
    Dec 19, 2004
  2. kath
    Replies:
    1
    Views:
    903
  3. dysgraphia

    Running several Perl scripts

    dysgraphia, Mar 17, 2007, in forum: Perl Misc
    Replies:
    2
    Views:
    117
    dysgraphia
    Mar 17, 2007
  4. Replies:
    6
    Views:
    187
  5. Replies:
    13
    Views:
    529
    Anno Siegel
    Sep 10, 2007
Loading...

Share This Page