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||!t op.window.frames['header']||!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><a href=<font color = red>"#"</font> onclick=<font color = red>"loadFrames('header-home.html','menu-<font color = blue>1.</font>html')"</font>>Click here</a></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 ]