|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I have a website at When a user logs into the above page we want the frames to appear with the nfsc in the main page Is there any java that can do this ? Also we also want to give the user the option to break out of these frames. So the user can click on a link that will break the frames How can we do this ? Cheers Funkyirishman ![]() |
|
#2
|
|||
|
|||
|
If you place this code in your body-tag:
Code:
<body onload="if (top!=self) top.location=self.location;"> It will break out of the frames. Just put in the page that you wan't to break out of the frames. If you wan't to use a link to break out of the frames: Code:
<script type="text/javascript">
<!--
function breakout(){
if (top!=self) top.location=self.location;
}
-->
</script>
<a href="javascript:" onclick="breakout();">Break out</a>
I guess your frameset has a name, just redirect to that page name if the login is a success and the frames should appear. I do this myself when I login to my admin-pages. (Which is the only time I use frames). If you don't have to use frames, don't use them, to many disadvatages. |
|
#3
|
|||
|
|||
|
Hi EiSa
Thanks for that Do I put the below on all my pages ? <body onload="if (top!=self) top.location=self.location;"> Or do I just put them in the left frame and top frame My frameset page is this my home page Cheers Funkyirishman ![]() |
|
#4
|
|||
|
|||
|
You put <body onload="if (top!=self) top.location=self.location;"> only in those pages you wan't to break out of the frameset. If you put this code in the left frame or top frame, these pages will break out of the frameset.
Your frameset page is your homepage of worldeasy.com, and it's name is index.htm according to what I can see. |
|
#5
|
|||
|
|||
|
Frames & Orphan Pages
Hi EiSa
Thanks Sorry thought the script was for when a user logs into one of our pages the frames appear. You dont know a script that can do this ? Funkyirishman |
|
#6
|
|||
|
|||
|
Yes, there are script's that will force one page into a frameset. Have never used it. An example of this you can see here:
http://www.ballade.no Try to open up any link in a new window and you will see what I mean. Perhaps you can find some answer here: http://developer.irt.org/script/frame.htm |
|
#7
|
|||
|
|||
|
Frames & Orphan Pages
Hi EiSa
This is the script I need I think but where can I amend it to suit my webpage to incorporate my left frame and topper frame Dont know where to amend the below script ? Thanks Funkyirishman <script language="javascript" type="text/javascript"> <!-- // URL til side som default lastes i hoved_frame pageURL = "/nmi.nsf/doc/ballade"; // script som sjekker om det er sendt inn en URL, og parser denne if (parent.document.URL) { parentURL = parent.document.URL; if (parentURL.indexOf('=') != -1) { pageURL = parentURL.substring(parentURL.indexOf('=')+1,paren tURL.length); } } if (top != self) { if (document.images) top.location.replace(self.location.href); else top.location.href = self.location.href; } else { document.write('<frameset cols="*,795,*" border="0">'); document.write('<frame name="venstre" src="/mic.nsf/g/dummy.html" framespacing="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>'); document.write('<frameset rows="140,*" border="0">'); document.write(' <frame name="topp_frame" src="/mic.nsf/g/ballade_topp.html" framespacing="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>'); document.write(' <frame name="hoved_frame" src="' + pageURL + '" marginwidth="0" marginheight="0" scrolling="yes" frameborder="0">'); document.write('<\/frameset>'); document.write('<frame name="hoyre" src="/mic.nsf/g/dummy.html" framespacing="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>'); document.write('<\/frameset>'); } --> </SCRIPT> |
|
#8
|
|||
|
|||
|
The script you have found you should put into the page that holds the frameset code (index.htm), I shall translate the beginning of the code:
// URL to page which shall be loaded into main frame pageURL = "/nmi.nsf/doc/ballade"; // script which chek's if it's sent a URL, and parses this one if (parent.document.URL) { parentURL = parent.document.URL; if (parentURL.indexOf('=') != -1) { pageURL = parentURL.substring(parentURL.indexOf('=')+1,paren tURL.length); } In every page that they wan't to force into the frameset, they have used this code (yourfile.htm is the name of this page): <script language="javascript" type="text/javascript"> <!-- if (top.location == self.location) { // If the page isn't in a frameset if (document.images) top.location.replace("/yourfile.htm" + "?opendocument&url=" + window.location.href); else top.location.href = "/yourfile.htm" + "?opendocument&url=" + window.location.href; } //--> </script> This is how they have done this, I tested it myself, but it wouldn't work as intended so I can't help you more with this problem. I think the answer is here: http://developer.irt.org/script/frame.htm, but I'm not sure. |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Web Development > Frames & orphan Pages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|