indiWiz.com
SiteSearch:
Jump:

Site Map | WizTools.org | jCraze Blog
Web Developer's Den!
Home : WDD : JavaScript
This Article...
Print Version
Add Comment
View Comments
JavaScript
The Bare Facts
Rollover Script
Script Windows
Status Message
Time Sensibility of JavaScript
JavaScript and Frames
Expandable Menus
Cursor Effects!
Regular Expressions Reference
JavaScript Screen Size
JavaScript HTMLize (Using Regular Expressions)
Java Script Dynamic Time Update
Sections

Commniquè
Sign Guestbook!
Read Guestbook!
MailMe!

JavaScript & Frames

Loading a File Only Through a Frame

When you submit your framed pages to search engines, more often you are likely to see the 'inner pages' indexed than the main frame page. In such moments you would want to load the 'inner' pages automatically in the frame page. The code which you have to add to the individual pages(in the HEAD section) is:

<script language="JavaScript">
<!--
if(top==self)
self.location.href = "index.html";
//-->

Note: 'index.html' is assumed to be the frame page.

Frame Busters

If your visitors come from a site which does not provide with a link for jumping out of it's frame, it is time you provided such a link!

<script language="JavaScript">
<!--
function jump(){
top.location.href = self.location.href;
}
//-->
</script>

The link to access this function(jump()):

<a href="javascript:jump()">Break Free from Frames!</a>


User Comments

Add Comment

[Quick Stats: Number of main threads: 0, Number of sub-threads: 0]

Sign Guestbook | Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.