
Originally Posted by
Yukoner
The frame name was already there in the HTML Frames Page and still could not target it. If I use
javascript:parent.myframe.location=http://www.mypage.com (the happy face is replacing a "colon p"
Use the advanced editor and disable smilies.
it will target the frame needed but then leaves the original page blank except puts the text http://www.mypage.com on it.
OK, almost home. You need to quote literals in that type of statement and using the href object is good form (will keep you out of trouble in certain situations):
Code:
javascript:parent.myframe.location.href='http://www.mypage.com'
But, used as an href, it will still be active on the 'sending' page just as you describe. Used in other situations, the javascript: convention is not required. The best method in a link is (requires no javascript at all):
HTML Code:
<a href="http://www.mypage.com" target="myframe">My Page</a>
or, in raw code (javascript enabled required):
Code:
parent.myframe.location.href='http://www.mypage.com'
Or, if you must use an onclick javascript event in a link (javascript assists but is not required to be enabled):
HTML Code:
<a href="http://www.mypage.com" target="myframe" onclick="parent.myframe.location.href=this.href;return false;">My Page</a>
or (also javascript assists but is not required to be enabled):
HTML Code:
<a href="http://www.mypage.com" target="myframe" onclick="window.open(this.href,this.target);return false;">My Page</a>
There really are many, many ways to do this in raw code or as an event. The above is only a partial listing.
Bookmarks