Solved

can't use target="right" in perl ?

Posted on 1998-10-14
6
177 Views
Last Modified: 2012-05-04
This is part of a perl script. It is in a left frame but I want result in right frame. Can I do that . Thanks
print &PrintHeader;
print<<"print_tag";
<html>
<head>
<title> output</title>
</head>
<body>
<img src=../$jpgfile target="right">
</body>
</html>
print_tag
0
Comment
Question by:aja101498
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:rajgn
ID: 1205341
An IMG tag cannot have 'target' atribute unless it's a link. In your case it's not a link. Hence target will not work. If you want to make the image as a link, targetted to right, replace

<img src=../$jpgfile target="right">
      with
<A HREF='something.html' target='right'><img src=../$jpgfile></A>
0
 

Author Comment

by:aja101498
ID: 1205342
No, I don't want a link. Is there a way to display the image in the right frame witout clicking anything. Do the calcualtion and immediately place the image in th desired frame . thanx
0
 
LVL 2

Accepted Solution

by:
shchuka earned 100 total points
ID: 1205343
Yes, you can do it with javascript.  You can do the following to achive your goal (the code assumes that you have a frame named "right"):

print &PrintHeader;
print<<"print_tag";
<html>
<head>
<script language="JavaScript">
<!--
top.right.location="../$jpgfile";
//-->
</script>
</head>
</html>
print_tag

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:aja101498
ID: 1205344
Ok, good. If I copy & past your code in a PERL script, it is going to work provided that there is a frame called right. Is that right ?

I have n't seen a javascript in a perl program before. I hope that is feasible. Thanks
0
 
LVL 2

Expert Comment

by:shchuka
ID: 1205345
Yes - I tested my code before pasting it here.
My main html page looked like this:
<html>
<frameset cols="50%,50%">
    <frame name="left" src="left.html">
    <frame name="right" src="right.html">
</frameset>

the left.html file had something like this:
<html>
<form method=post action="test.pl">
<input type=submit value="submit">
</form>
</html>

And finally my test.pl file contained the code that I pasted in my answer.
Hope, this helps,
-Aleks.
0
 

Author Comment

by:aja101498
ID: 1205346
thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question