August 12th, 2000, 09:16 AM
-
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?
August 12th, 2000, 12:34 PM
-
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..."
August 12th, 2000, 01:39 PM
-
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"
August 13th, 2000, 05:32 AM
-
>>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.
August 13th, 2000, 06:43 AM
-
It si true, it works only with Netscape !
August 13th, 2000, 07:01 AM
-
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).]