Thread: frames...

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    71
    Rep Power
    14
    I have two frames page and script is called from form on 2nd frame. I don't want to put target="first" statement within <FORM> tag, because script has to decide to which frame to print, and I don't want to print both frames from script since there is lots of graphics.

    Can I print from my perl script to specific frame on page without reloading second frame?
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    you can give a frame name in your perl script like the following..


    #!/usr/bin/perl

    print "Window-target: yourframenamen";
    print "Content-type: text/htmlnn";

    print "<html>n";
    ......
    print ",/html>n";


    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    71
    Rep Power
    14
    I have tried this and it always print in same frame - the one from which script is called

    if ($broj < 50){
    print "Window-target: leftn";
    print "Content-type: text/htmlnn";
    print "This is first frame";
    } else {
    print "Window-target: rightn";
    print "Content-type: text/htmlnn";
    print "This goes to 2nd frame";
    }

    and I called script from page containing frames "left" and "right"
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Can I print from my perl script to specific frame on page

    I also replied to the same questions dozen times.

    >>I have tried this and it always print in same frame - the one from which script is called

    Once again, this line ->
    print "Window-target: yourframenamen";
    is all you needed. If your if ($broj < 50){ example didn't work, it could be the problem with your script, you need to simplify your script to begin with.

    However, I read a message here saying that "Window-target:" only work with Netscape, not with IE, I haven't used IE for long time, so I won't bother to test whether it's true or not with such non-standard browser. So please test it with Netscape first.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    71
    Rep Power
    14
    It si true, it works only with Netscape !
  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    What you could do is to ban IE users by detecting the HTTP_USER_AGENT output or require them to use Netscape only.

    Or a work around would be to have your script rewrite the output of your form along with the <form ..target=..> tag, which is, requiring your users TWO clicks in order to get the actual output to the target frame. That also means the frame that contains your form would be self-loaded at least once.

    Anyway, here is an example..

    if (($ENV{'HTTP_USER_AGENT'} =~ /^Mozilla/) && ($ENV{'HTTP_USER_AGENT'} !~ /compatible/)) {
    &netscape;
    else {
    &all_others;
    }

    sub netscape {
    if ($broj < 50){
    print "Window-target: leftn";
    print "Content-type: text/htmlnn";
    print "This is first frame";
    }
    else {
    print "Window-target: rightn";
    print "Content-type: text/htmlnn";
    print "This goes to 2nd frame";
    }
    }
    sub all_others {
    if ($broj < 50){
    print "Content-type: text/htmlnn";
    print "<form method=POST action="script.pl" target="left">n";
    print "<input type="hidden" name="whatever1" value="whatever1">n";
    print "<input type="hidden" name="whatever2" value="whatever2">n";
    print "<input type="submit" value="Since you are not using Netscape, please click here to continue">n";
    print "</form>n";
    }
    else {
    print "Content-type: text/htmlnn";
    print "<form method=POST action="script.pl" target="right">n";
    print "<input type="hidden" name="whatever1" value="whatever1">n";
    print "<input type="hidden" name="whatever2" value="whatever2">n";
    print "<input type="submit" value="Since you are not using Netscape, please click here to continue">n";
    print "</form>n";
    }
    }

    [This message has been edited by freebsd (edited August 13, 2000).]

IMN logo majestic logo threadwatch logo seochat tools logo