Click to See Complete Forum and Search --> : Problem with Frame Branding


Earl
06-09-2003, 08:28 AM
I'm using this script http://javascript.internet.com/navigation/frame-branding.html on my site at http://machenfamily.com

It works great but I would like;

The content opened in the same window instead of a new one, is that possible?

The "Close" button I added to the banner at the top will not close the window for some reason, what am I doing wrong?

Thanks in advance!

Khalid Ali
06-09-2003, 09:15 AM
You need to make a little code change.
Here is the one link for example from the link you posted above

<a target="_new" href="http://www.lycos.com/" onClick="return frameBranding('http://www.lycos.com', 'http://javascript.internet.com/navigation/frame-branding-thanks.html', 'cols');">Lycos (with cols branding)</a>

In the very beginiing there is an attribute

target="_new"

change this to this

target="_self"

and the frames will open in the current window.

Earl
06-09-2003, 11:01 AM
I don't even use _new in the link. They javascript itself opens a new window. Is there an extra piece of code I need to add to the javascript or change something for it to open in the same window?

Khalid Ali
06-09-2003, 11:06 AM
You will need to post javascript code for at least this function

frameBranding

Earl
06-09-2003, 11:59 AM
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Grace Li (gl105@yahoo.com) -->
<!-- Web Site: http://www.sysu.net/gl105 -->
<!-- Modified By: Ronnie T. Moore, Editor -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
percent = "10%";
function frameBranding(actualurl, brandingurl, frametype) {
var framewin = window.open("","brandingframe");
with (framewin.document) {
write("<html><frameset " + frametype + "=" + percent + ",*>");
write("<frame src=" + brandingurl + ">");
write(" <frame src=" + actualurl + ">");
write("</frameset></html>");
}
return false;
}
// End -->
</script>

Earl
06-09-2003, 04:27 PM
Would you use window.open.self ?