PDA

View Full Version : Dreamweaver


Marty
08-20-2001, 01:06 PM
Hi,

I'm using behaviours to generate a 'pop up browser', fairly straightforward... I am unable to have the links in the pop up page relate back to (open up in) the main page. Use of self/parent etc does not work and the only option is to open other page! or it opens the links in the re-sized browser!! both of which are not the point to the pop up window.

Anyway an suggestions / solutions?

Marty:\ :\

esc
08-22-2001, 05:14 AM
Hi Marty,

Give this code a try:


<script language="JavaScript">
<!--
function MMF_changeParentDocument(url) {
opener.location = url;
window.close();
}
//-->
</script>

...

<a href="javascript:MMF_changeParentDocument('linkpage.html);">linkpage</a>

Put it into the popup. It should show the linked page in the main window. If you do not want the popup closed, then remove the window.close(); line from the script.

Additionally I put an onLoad="self.focus()"; handler into the body tag of the popup, to have it on top, when somone tries to open it while already open but invisible.

Erich
['javascript' in the tag should be one word! The space is added by the bulletin board]

Marty
08-22-2001, 07:52 AM
Hi Ecs,

Many thanks for your help. I entered the script onto the window and only changed this section:

<a href="java script:MMF_changeParentDocument('mylink.htm);">MY LINK NAME</a>

Nothing worked, this time it did not even open in itself! Any ideas?

Thanks
Marty

bturner
08-22-2001, 01:27 PM
<a href="java script:MMF_changeParentDocument('mylink.htm);">MY LINK NAME</a>


There are some errors in the code above. 1) There should be no space between "java" and "script". 2) you are missing the closing single quote after .htm.

This should work here:


<a href="JavaScript:MMF_changeParentDocument('mylink.htm');">MY LINK NAME</a>


NOTE: It seems the vBulletin software is adding that space between java and script. Just remove that space yourself, and it should work.

Hope that helps!
Bill

Tibbits
08-22-2001, 02:04 PM
I assume VB has sanitised the code to prevent people playing nasty tricks with javascipt.