Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Targeting 2 frames

Targeting 2 frames
Thread Tools
Mac Elite
Join Date: Jan 2001
Location: .CL
Status: Offline
Reply With Quote
Feb 17, 2002, 11:03 AM
 
I am building a website where i use frames, i need that the links in my nav bar target 2 frames (the nav frame and the main content frame) i am using GoLive and to target both frames i used the action 'Target 2 frames' that comes with GL.
My problem is, the actions works perfectly in my mac in IE, OmniWeb and Netscape. But when i test it in IE for Windows it gives me a runtime error: 'CSAct is undefined'.

Anyone knows why the Javascript is reporting this error in Windows while working flawlessly in the Mac?

How can i fix this in order to use a more "compatible" script that work in Windows?

I'd appreciate any help.
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Feb 17, 2002, 04:49 PM
 
Originally posted by ARENA:
<STRONG>I am building a website where i use frames, i need that the links in my nav bar target 2 frames (the nav frame and the main content frame) i am using GoLive and to target both frames i used the action 'Target 2 frames' that comes with GL.
My problem is, the actions works perfectly in my mac in IE, OmniWeb and Netscape. But when i test it in IE for Windows it gives me a runtime error: 'CSAct is undefined'.

Anyone knows why the Javascript is reporting this error in Windows while working flawlessly in the Mac?

How can i fix this in order to use a more "compatible" script that work in Windows?

I'd appreciate any help.</STRONG>
As much as I love GoLive, it does generate quite a lot of overhead crap to make sure it is as compatible and browser-proof as possible. And sometimes that extra bumpfh does nothing but cause headaches, as you're seeing.

If you look through the source code for the action, you'll see the following lines:<font face = "courier">

parent.frames[action[1]].location.href = action[2]
parent.frames[action[3]].location.href = action[4]

</font>This is the business end of your action. But it's a bit sparse. First you'll need to do a test to make sure your browser window contains the two frames that you have defined, then if they exist, load the two parameters straight in. In fact, it's a lot better if you use the 'location.replace' rather than 'location.href' because it won't stuff up people's browser history so much. Here's a function you can use for yourself. Replace 'header' and 'left' with the names of your frames.

<font face = "courier">function loadFrames( loc1 , loc2 ) {

if (!top.window.frames.length&#0124;&#0124;!t op.window.frames['header']&#0124;&#0124;!top.window.frames['left']) {
top.location.replace('path-to-your-frameset.html');
} else {
top.header.location.replace(loc1);
top.left.location.replace(loc2);
}
}

</font>And an example of a function call within your HTML:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>&lt;a href=<font color = red>"#"</font> onclick=<font color = red>"loadFrames('header-home.html','menu-<font color = blue>1.</font>html')"</font>&gt;Click here&lt;/a&gt;</font>[/code]

Hope this helps. Oh yeah, one last thing. Frames are a pain in the @ss. Don't use them if you can help it!

[ AARRGGHHH.. UBB doesn't arf muck things up ]

[ 02-17-2002: Message edited by: Simon Mundy ]
Computer thez nohhh...
     
ARENA  (op)
Mac Elite
Join Date: Jan 2001
Location: .CL
Status: Offline
Reply With Quote
Feb 17, 2002, 06:10 PM
 
Well once again Simon, thanks for your help.
I'm not sure i understood all that, but i'll try it out to see if i can overcome my problem.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:07 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2