|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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..." |
|
#3
|
|||
|
|||
|
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" |
|
#4
|
|||
|
|||
|
>>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. |
|
#5
|
|||
|
|||
|
It si true, it works only with Netscape !
|
|
#6
|
|||
|
|||
|
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).] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > frames... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|