Output of my perl having a link to a javascript method .....

Hi,
    I have a html page with 2 frames. The upper frame is the output of  a perl program. There is a link in upper frame which should call a javascript
method to change the source of my lower frame.  
   Now how do the output of my perl program have a link pointing to some javascript method in parent page.

Regards,
Pankaj
pankaj_gargAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jhurstConnect With a Mentor Commented:
I agree with your rejection since somewhow EE lost the second part of my response, here it is again:

You need something like the following, where the test.htm will create two frames, the lower one then invokes a function in the upper:

test.htm:
<html>
<frameset rows=200,*>
<frame src=test1.htm>
<frame src=test2.htm>
</frameset>
</html>

test1.htm - this has the function
<HTML>
<body>
<script>
function f()
  {alert("What");
  }
</script>
</body>
</html>

test2, this invokes the function, after a delay:
<HTML>
<body>
test2
<script>
setTimeout("self.parent.frames[0].f()",1000);
</script>

</body>
</html>
0
 
jhurstCommented:
This is not a perl problem but a Javascript one
0
 
pankaj_gargAuthor Commented:
Hey Jhurst,
      Sorry for delayed reply, I was not in town.

Actually my problem is bit different, I have several
links in test1.html
like link1 , link2 ......linkn and depending on the
link you clicked on I have to change the source
file for the second frame ie change test2 to something
else.
 I have to develop something like a FAQ list , depending on the question you click, I have to display
the corresponding details from a file.

Pankaj
 
0
 
pankaj_gargAuthor Commented:
Hey Jhurst,
      Sorry for delayed reply, I was not in town.

Actually my problem is bit different, I have several
links in test1.html
like link1 , link2 ......linkn and depending on the
link you clicked on I have to change the source
file for the second frame ie change test2 to something
else.
 I have to develop something like a FAQ list , depending on the question you click, I have to display
the corresponding details from a file.

Pankaj
 
0
 
jhurstCommented:
same method will work.  I have shown you how to access the objects of the other frame.  You can just:
<input type=button onClick=whatever() ...
and the whatever() can reach into the self.parent.frames and change the src values.
0
All Courses

From novice to tech pro — start learning today.