Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onclick to load on parent.parent frame

Status
Not open for further replies.

rachelason

Programmer
Joined
Jun 28, 2004
Messages
114
Location
GB
Hi Can someone help me on this...
I have a link which on click loads on the parent.parent frame.. the problem iam having is, it first loads on the current page then refreshes to load on the parent frame. What should i change in the code to avoid this?

<a onclick="parent.parent.location.href=this.href;" href="/ssl/content/property.html" name="propr" value="2" class="text"><img src="/ssl/image/prop1.jpg" height="100" width="120" alt="Property Image" border="1"></a>

thanks
Rach
 
>>I have a link which on click loads on the parent.parent frame.. the problem iam having is, it first loads on the current page then refreshes to load on the parent frame

confused.

do u mean javascript is executed after the link's href is executed???

Known is handfull, Unknown is worldfull
 
HI! looks like that's what happening.
 
try this:
<a onclick="parent.parent.location.href=this.href;location.href='/ssl/content/property.html';return false;" href="javascript:;" name="propr" value="2" class="text">

Known is handfull, Unknown is worldfull
 
thanks a lot..that worked like a charm.
cheers
Rach
 
no I am sorry, it didn't work....i am getting some error message...
 
It says it can't find the file...'javascript'...
 
thats strange. javascript:; is valid (:; is important)...

Known is handfull, Unknown is worldfull
 
vbkris - for some variation (and to prevent people thinking I have a typo when using :; I have started recommending that people use ://; instead:
Code:
<a href="javascript://;"...
Just another way to do the same thing really [smile]

Jeff


[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
HI I do appreciate your help...
now it says syntax error (in javascript://;)
rach
 
can i have the code???

Known is handfull, Unknown is worldfull
 
<a onclick="parent.parent.location.href=this.href;location.href='/ssl/content/property.html';return false;" href="javascript://;" name="propr" value="2">
 
How about this? How does it behave?
[tt]
<a href="javascript:parent.parent.location=this.location;this.location='/ssl/content/property.html'" name="propr" value="2" class="text"><img src="/ssl/image/prop1.jpg" height="100" width="120" alt="Property Image" border="1" /></a>
[/tt]
 
HI ! i am afraid the page doesn't display at all.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top