try another color scheme:


Go Back   TECH6.0 > Get Techie > Programming > HTML/CSS/JavaScript


Frame Jamming Tutorial

This is a discussion on Frame Jamming Tutorial within the HTML/CSS/JavaScript section, part of the Programming category; Websites using Framesets often face a problem of displaying the Frame alone when opened directly through browser instead of automatically ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-03-2008, 04:56 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default Frame Jamming Tutorial

Websites using Framesets often face a problem of displaying the Frame alone when opened directly through browser instead of automatically adjusting the Frame within the Frameset.

To solve this issue, simply read below:-

1. Enter the code below in your Frameset.html within the HEAD tag i.e. between <HEAD> </HEAD>

Code:
<script>
if (self != top)
    top.location.replace(self.location);

function frameJammer_hp(){
    var framedPage = location.search;
    if (framedPage.length > 1){
        framedPage = framedPage.substring(1);
        var theSplit = framedPage.indexOf('~');
        var thePage = framedPage.substring(0,theSplit);
        var theFrame = framedPage.substring(theSplit+1);
        eval("top."+theFrame+".location.replace('"+ thePage+"')");}
    }

var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_iemacdud = (agt.indexOf('msie')!=-1) && (agt.indexOf('mac')!=-1) && (is_major < 4);
if (is_iemacdud){setTimeout('frameJammer_hp()',1500);}
</script>
2. Next, while creating the Frameset, you must call the function i.e. frameJammer_hp() created in the 1st Step. You can do so by simply using the onload attribute of Frameset tag.

See the example below where we create a Frameset containing two Frames (bannerframe.html and content.html):-

Code:
<frameset rows="192,*" cols="*" framespacing="0" frameborder="no" border="0" onload="frameJammer_hp()">
  <frame src="bannerframe.html" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
    <frame src="content.html" name="mainFrame" id="mainFrame" />
</frameset>
3. Now, we are ready to jam all the Frames using this Frameset. Simply add this code to each Frame.html i.e. the pages that you want to be displayed only within the Framesets irrespective of whether opened directly or not.

Code:
<script>
if (window.name!='mainFrame')
        top.location.replace('Frameset.html?Iamjammed.html~mainFrame');
</script>
* where mainFrame is the name assigned to a specific Frame (See Step 2) and where you actually want to place all your main Frames.
* where Iamjammed.html is the current frame's name i.e. the file where you are placing this code in.
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #2  
Old 20-05-2008, 09:59 AM
iBlake's Avatar

Techie
 
Name: Blake
Join Date: May 2008
Location: United States
Phone: Not in the list
Posts: 91
iBlake is on a distinguished road
Send a message via MSN to iBlake
Default

Nice Information

Keep up the good work.
__________________
My iPhone is better than yours...........

I Am Back!
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 12:19 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top