I have a pretty standard page with a menu down the left and when you click a link, it populates the main body of the page using JavaScript to show the frame. This works fine in IE and FF but in Chrome instead of just changing the frame in the body, it just treats it as a standard link and my menu disappears.
I've tried adding target="_parent" to the frame, different ways of accessing the frames[] (parents.frames for example) but still can't get it to display nicely in Chrome.
Using your code and markup, I can't replicate the problem, locally or online.
Are you sure there's nothing in the target files that might make them break-out of a frame?
Any suggestions as to what could make it break-out of a frame? This is my first time using frames and it's part of a legacy app that hasn't been touched in a few years.
it must be something else, because the below works fine in Chrome 19. Have you tried with absolute urls?
Thanks for that, I have tried absolute urls and still no luck.
Not sure if it helps but there is one more higher level of menus than I originally posted. At first there are 2 options, selecting one of these expands the menu, ie:
Code:
<li>
<a href="examples/v3_5_0/addresshelper.html" onclick="expandCollapseDiv('div1');changeFrameURL(this.href);return false;">Div1 <span style="font-size: 8px;color: #938989;">@TAG@</span></a></li>
<div class="example" id="div1" style="display:none;">
<ul class="level4">
... original menu links posted live here
</ul>
</div>
Function to display the expanded menu (just changes style.display)
Code:
function expandCollapseDiv(_2){
var _3=document.getElementById(_2).style.display;
if(_3=="none"){
document.getElementById(_2).style.display="block";
}else{
document.getElementById(_2).style.display="none";
}
return true;
}
I have noticed that the first time you expand the top level menu, the frame changes fine (changeFrameURL() gets run here). It's only after clicking one of the lower level menu options and jumping to a particular div, ie:
Any suggestions as to what could make it break-out of a frame? This is my first time using frames and it's part of a legacy app that hasn't been touched in a few years.
Try pasting this into the address bar in Chrome while you're on the relevant page, then press Enter. :
Note that javascript: will probably be stripped out and have to be re-typed manually. If you still lose the frame then it must be something in the target page, although I can't imagine anyone having installed a Chrome-specific frame breaker.
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!
It jumps to the correct div and everything looks fine. So I guess that means it's not something in the target frame causing the problem and that it can find the correct page no problems. Not really sure where this leaves me. I am running out of ideas as to what would be causing the problem.
Bookmarks