• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1783
  • Last Modified:

How to use <a href > with parent.frames ?


In a web page, I have a link as <a href > in frame "left" and need to show a second web page in frame "right"... How can I do it?

This gets error:

<a href=''=parent.frames["right"].location.href= 'WebPageToShow.aspx' >
</a>

Thanks!
0
Desperate34
Asked:
Desperate34
  • 2
1 Solution
 
venkateshwarrCommented:
<a href='javascript:parent.frames["right"].location.href= "WebPageToShow.aspx"' > </a>

or

<a href="#" onclick='parent.frames["right"].location.href= "WebPageToShow.aspx"' > </a>
0
 
lil_puffballCommented:
You can also just do this:

<a href="WebPageToShow.aspx" target=right>Click</a>
0
 
lil_puffballCommented:
Also, make sure you've named the frames, or else it won't work:

<frameset cols=50%,50%>
<frame name=left src=left.htm>
<frame name=right src=right.htm>
</frameset>
0
 
Michel PlungjanIT ExpertCommented:
Better than

<a href="#" onclick='parent.frames["right"].location.href= "WebPageToShow.aspx"' > </a>
would be


<a href="#"
onclick="parent.frames['right'].location.href='WebPageToShow.aspx';
return false" >... </a>

but lil_puffballs suggestion is the most sensible unless you MUST use script

Michel
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now