Free Web Hosting PHP/mySQL
GlobalWeb.com.ru Forum Index GlobalWeb.com.ru
Free Web Hosting :: Commercial Web Hosting :: PHP/mySQL :: CGI/Perl
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Keeping pages in frames. (JavaScript)

 
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Javascript
Author Message
G-Bomb



Joined: 29 Feb 2004
Posts: 73

PostPosted: Mon Mar 01, 2004 8:46 pm    Post subject: Keeping pages in frames. (JavaScript) Reply with quote

These scripts will allow any pages that wish to stay within the frames that you may have on your website.

Insert this code on the frames page itself:

Code:
<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript"><!--

//   Automatically Maximize Screen
if (parseInt(navigator.appVersion) > 3)  {
   if (navigator.appName=="Netscape")  {
      if (top.screenX > 0 || top.screenY > 0)
         top.moveTo(1,1);
      if (top.outerWidth < screen.availWidth)
         top.outerWidth = screen.availWidth;
      if (top.outerHeight < screen.availHeight)
         top.outerHeight = screen.availHeight;
   }
   else  {
      top.moveTo(-1,-1);
      top.resizeTo(screen.availWidth + 1,screen.availHeight + 1);
   }
}

//   Puts correct page in body section

pageURL = "body.htm";
if (parent.document.URL)  {
   parentURL = parent.document.URL;
   
   if (parentURL.indexOf('?') != -1)  {
      pageURL = parentURL.substring(parentURL.indexOf('?')+1,parentURL.length);
   }
}

function fillFrame()  {
   parent.body.location.href = pageURL;
}

// --></SCRIPT>
</HEAD>

<FRAMESET COLS="15%,*" BORDER="0" FRAMEBORDER="0" onLoad="fillFrame();">
   <FRAME SRC="margin.htm" NAME="margin" NORESIZE target="body">
   <FRAME SRC="javascript:parent.blank" NAME="body" NORESIZE target="body">
</FRAMESET>
</HTML>
Back to top
View user's profile Send private message
G-Bomb



Joined: 29 Feb 2004
Posts: 73

PostPosted: Mon Mar 01, 2004 9:39 pm    Post subject: Reply with quote

Finally, add this code to the top of every page that you want to stay inside the frames you just made above:

Code:
if (top.location == self.location)  {    //  if page is not in its frameset
   top.location.href = "http://www.YOURSITEHERE.com/frameset.html" + "?" + window.location.href;
}


Replace "http://www.YOURSITEHERE.com/frameset.html" above with the URL of the frames page that you made in the post above this one.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    GlobalWeb.com.ru Forum Index -> Javascript All times are GMT
Page 1 of 1

 


Free Web Hosting, Commercial Web Hosting, PHP/mySQL Copyright © 2009
Free Scripts Directory | Free Software Downloads | Newsgroups Directory | Optel.net | Mirroraty | Cruised.net | Hardware Keylogger