PDA

View Full Version : Coolframemenu doesn't load when linked to outside


ashwen
13.05.2001, 02:49
I am having problems with the coolframe menu when linking items in the menu to outside pages. Only the top menu shows and none of the lower level items show. Does any one know what's wrong?

bratta
13.05.2001, 13:36
When you load a new page in your main frame the script tries to "write" to the new page in the main frame. When loading a page in the main frame that is not on the same domain as your menu script, the script will not have permission to update the page, so the script won't work. This is not something I can fix, the browsers are made like that for security reasons. I have however added a error trapping function that should stop the page from giving you a error if you choose to load pages from another domain in your main frame, and the top menu items should still work. So if you have links "back" to your pages on the top items they should still work.

The best solution however is to try and avoid loading pages from other domains in your main page and load them in a new window in stead.


-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com

ashwen
13.05.2001, 16:41
Thanks Bratta for the prompt reply. You are a great help!

PSECU
14.05.2001, 14:39
Is there any way that I could have the owners of a different domain point to a javascript file that would give me permissions to use this technology?

I was going to use the previous version, CoolFramesMenu, and have them include a direct address to the cframe.js file.

Example...
<SCRIPT LANGUAGE="JavaScript1.2" src="http://www.mydomain.com/scripts/cframe.js" TYPE="text/javascript"></SCRIPT>

It would be great if we could have the best of both worlds (CoolFrameMenus and CoolMenus3).


Virtually yours...
Craig Malcolm Petrou
Webmaster, PSECU
cpetrou@psecu.com

bratta
14.05.2001, 17:04
There are a lot of security issues involved here. As far as I know you can allow different domains as long as they are subdomains. And you can have something called signed scripts in Netscape, but I have to admit that I really don't know much about this stuff.

If anyone does feel free to tell us about it.

-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/

PSECU
15.05.2001, 09:42
The rest of our site is framed. The pages I am attempting to link to are co-branded pages on other Domains. These other sites can not add our custom navigation. We are also trying to eliminate opening other windows, since it has been one of our largest complaints.

Virtually yours...
Craig Malcolm Petrou
Webmaster, PSECU
cpetrou@psecu.com

bratta
15.05.2001, 12:00
Right.. And you could do this when the coolFrameMenus had the cframe.js file right?

Then for a quick test try this:

add: onload="parent.MENU_FRAME_NAME.cm_checkLoaded()" in the body tag of the document in the other domain. Let me know if that works.

If it doesn't I'll try and find another solution.

-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/

PSECU
15.05.2001, 14:42
I had tried adding onload="parent.MENU_FRAME_NAME.cm_checkLoaded()" in the BODY tag of a site on another server...
http://www.mixolplix.com/tinnitus/

I received the following JavaScript error...
Line: 19
Char: 1
Error: 'parent.MENU_FRAME_NAME' is null or not an object'
Code: 0
URL: http://www.mixolplix.com/tinnitus/index.html

When I switched the body tag to read...
onload="parent.frmTop.cm_checkLoaded()"

I received the follwoing error...
Line: 19
Char: 1
Error: Permission denied
Code: 0
URL: http://www.mixolplix.com/tinnitus/index.html

Any other suggestions???

Virtually yours...
Craig Malcolm Petrou
Webmaster, PSECU
cpetrou@psecu.com

bratta
15.05.2001, 16:08
ok.

Make a js file with this content:

onload=parent.frmTop.cm_checkLoaded;

and save it on the same server as you have your menu on as cframe.js

Then link that file to the pages in the other domain like this:

<SCRIPT LANGUAGE="JavaScript1.2" src="http://www.menudomain.com/scripts/cframe.js" TYPE="text/javascript"></SCRIPT>


Did that work?


-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/

PSECU
15.05.2001, 16:49
That didn't seem to work either. Please double check my script at...
http://www.mixolplix.com/tinnitus/index.html

As well as...
http://www.mixolplix.com/tinnitus/scripts/coolmenus3d.js

Thanks!!!

Virtually yours...
Craig Malcolm Petrou
Webmaster, PSECU
cpetrou@psecu.com

bratta
20.05.2001, 09:46
PSECU: I have done some testing on this. In another thread you said that it did work with the old cframe.js. And after testing it a while I saw that it worked in NS4, but not in explorer. So explorer has a more strict security check. Then I tested different things and as far as I can see there's actually no way to get that to work (even in the old coolFrameMenus), at least not in Explorer 5+. And it's due to the security of the browsers, not the script. I also looked at the documentation and it states the same thing.

-Thomas Brattli-
http://www.bratta.com/
http://www.dhtmlcentral.com/