| |||||||
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 ...
![]() |
|
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
| 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>
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>
Code: <script>
if (window.name!='mainFrame')
top.location.replace('Frameset.html?Iamjammed.html~mainFrame');
</script>
* where Iamjammed.html is the current frame's name i.e. the file where you are placing this code in.
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
|
#2
| ||||
| ||||
|
Nice Information Keep up the good work.
__________________ My iPhone is better than yours........... I Am Back! |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |