Jump to content
xisto Community
Sign in to follow this  
Nani Cheri

Problem With 'target' In Html

Recommended Posts

Hi, I have this menu on my site which is build in a table. when pointing over a cel with mouse, the background of the cell changes in white and produce a special code:

<td align="center" bgcolor="#D6C2B4" class="bodystyle" style="font: 9px Verdana" onClick="location.href='about.htm'" onMouseOver="this.style.background ='#FFFFFF'" 		  onMouseOut="this.style.background='#D6C2B4'">ABOUT</td>

The normal linkcode <a href="...'> is replaced by , onClick="location.href='...'"
I want to open this link in a iframe. so i thought using target would do like this:

onClick="location.href='about.htm'" target=iframe1 etc...

but that doesnt work in combination with the code above.
however the page does load in iframe and with target=iframe1 etc, with a normal link like this:

<a href="about.htm" target="iframe1">Tea Tree.</a>

so the page which is linked to is typed correct in the code, and the target name is correct to. So what code should I use to open my menu item(cel) in an iframe??

Share this post


Link to post
Share on other sites

When you use the code location.href, you are just using short hand for self.location.href. It's quite simple to get it to load in a frame, just use some code like this:

parent.FRAMENAME.location.href="about.htm"
If that doesn't work then replace parent with top and see if that helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.