Cgi help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Scraper
    Confirmed User
    • Jan 2001
    • 182

    #1

    Cgi help

    If anyone with a bit of perl cgi exprience can help me out here, I'd appreciate it.

    I'm trying to embed javascript with a perl cgi script. So when the perl outputs its html code, it also outputs the javascript within the html.

    Can't get it to work though.
    Any ideas?
  • JT
    My mother was an EMU
    • Jan 1999
    • 202

    #2
    What doew the javascript look like that you are trying to embed.
    Make sure you backslash any character perl might interpert wrong.



    ------------------
    JT
    Because your life depends on Firestone.....
    Literally!

    Comment

    • JT
      My mother was an EMU
      • Jan 1999
      • 202

      #3
      Scraper send me your script and I will take a look at it. and make some suggestions.

      [email protected]
      or
      [email protected]

      Comment

      • G-Man
        Registered User
        • Jan 2001
        • 43

        #4
        2 Comments on this one.

        The backslash is constant battle for me, I always miss one of them while trying to change something. I would suggest the easiest way to do this would be to send the dat requireing the jave to be between the appropriate commands EOF instead of using the print command
        print "&#60HTML&#62&#60HEAD&#62&#60TITLE&#62$page_title& #60/TITLE&#62&#60/HEAD&#62\n";

        e.g.
        *****************************************

        print &#60&#60EOF;

        &#60HTML&#62
        &#60HEAD&#62
        &#60script language="javascript"&#62
        &#60 !--
        var WhatDaFk
        function WhatDa() {
        window.open('$image_dir/index.html','WhatDaFk','toolbar=0,location=0,direc tories=0,status=0,menubar=0,scrollbars=1,resizable =0,width=250,height=200');
        }
        // --&#62
        &#60/script&#62

        &#60/HEAD&#62
        &#60body&#62
        content goes here
        &#60/body&#62
        &#60/HTML&#62

        EOF
        &Footer;
        }

        *****************************************

        My 2cents
        Hope it May Help U

        ------------------
        http://www.brickwindows.com/shitforbrains/
        Get Anonymous Revenge
        Submit A Rebuttle in version 2 :-)

        [This message has been edited by G-Man (edited 01-16-2001).]
        ########################################
        My 2 cents - 1 penny and 1/3 to my US friends
        http://www.brickwindows.com/
        submit a joke for a permanent non-recip link

        Comment

        • Scraper
          Confirmed User
          • Jan 2001
          • 182

          #5
          Ah Excellent.
          Thanks for the example.

          JT, thanks for the offer.
          G-Man, also thanks, its working!

          Comment

          Working...