Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
nikonratm #1
javascript & iframes - help!
hello, I am trying to write a tiny snippet of js that prevents users from
accessing sub-frames of my site. the trick is, i want it to function such that
if a user goes to a sub-frame they are redirected to the top-level page with
the page they tried to access loaded in the correct frame.
The top-level page uses three iframes, the two of importance being
'contentFrame' and 'blogFrame' (as named in the html)
the code is broken up into three cases, the first is if the user tries to
access the blog directly, in which case they can simply be redirected to the
top level site which by default loads the blog into the 'blogFrame'.
the second case is if the user tries to access a single post page (the
substring(21,24) == '200' is just to do with how blogger formats its archive
pages), in which case I want to remember the accessed page (stored in the
'current' string), redirect to the top-level page, and then when the top-level
page loads, load the accessed page into the 'blogFrame'.
The third case is analagous to the second except that it is meant to load the
accessed page into the 'contentFrame'
I am not sure why this code doesn't work, any advice would be greatly
appreciated. Thanks!
--Code attached--
var topFrame = top.location.toString();
if(topFrame != "http://example.com/" && topFrame !=
"http://example.com/index.html"){
var current = window.location.toString();
if (current == "http://example.com/blog.html"){
window.location = "http://example.com/";
} else if (current.substring(21,24) == '200'){
var g = window;
g.location = "http://example.com/";
g.onLoad = function(){
g.frames['blogFrame'].location = current;
}
} else {
window.location = "http://example.com/";
g.onLoad = function(){
g.frames['contentFrame'].location = current;
}
}
}
nikonratm Guest
-
iFrames for CS3
Does anyone know before I buy it, if the iFrames Suite extensions work with Dreamweaver CS3? I'd like to put a frame of text (requiring a... -
iFrames
Hi, when I make a page in photoshop, do my rollovers in imageready , bring it to dreamweaver, make an iframe from a slice made in ps or ir, the... -
Frames and IFrames+SWF
Hi,This is the 3rd time I am trying to find a solution but it seems like no one is answering me. :-(.So to explain shortly. I want to make a page... -
iframes???
What are some of the drawbacks to iframes. When are they good and why should you use them. Thank you. B -
Help with IFrames
Hello I have a main pgae and I load an Iframe based on when the user clicks the tree nodes ,but when I save some records on the Iframe they should...



Reply With Quote

