Hi
I wrote the following code to force a page intended for frames into its frameset:
function ForceIntoFrames(MyLevelPrefix) { if (top == self) { var MyURL; MyURL=document.URL; top.location.href = MyLevelPrefix + "default.htm"; /* @@@ For some reason, this doesn't work without the alert??? @@@ */ alert("Click OK to display the page"); sjBody.location=MyURL; } }
It works okay, but not if I remove the alert. Instead, it processes “top.location.href”, displays the default.htm, then stops.
Added later: sjBody is the name of the target frame.
Any ideas? I don’t have too much experience with JavaScript, so I may be missing something obvious. Or maybe it’s some sort of timing issue?
Thanks
Dale