The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Perl Programming
|
frames...
Discuss frames... in the Perl Programming forum on Dev Shed. frames... Perl Programming forum discussing coding in Perl, utilizing Perl modules, and other Perl-related topics. Perl, the Practical Extraction and Reporting Language, is the choice for many for parsing textual information.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 12th, 2000, 09:16 AM
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 71
Time spent in forums: < 1 sec
Reputation 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?
|

August 12th, 2000, 12:34 PM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
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
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 71
Time spent in forums: < 1 sec
Reputation 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"
|

August 13th, 2000, 05:32 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
>>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
|
|
Contributing User
|
|
Join Date: Jun 2000
Posts: 71
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
It si true, it works only with Netscape !
|

August 13th, 2000, 07:01 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
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).]
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|