Web Hosting Directory | Web Hosting Resources | Webmaster Resources | Domain Tools | Search Engine Marketing | Forums
  Signup
Today: 393   Yesterday: 1,557   Max: 1,872   Total: 377,668   Current Users : 12 (Member 0) 
DOMAIN TOOLS

WEBMASTER TOOLS

RELATED ARTICLES

SUBMIT AN ARTICLE

Write for us and get publicity, link to your website, and best of all get paid. Please visit our writers page for details.


LINK TO US

Link to us and earn points for each visitor you bring to us. Please visit our link partner page for details.

 

Do Get Framed

Sometimes a particular web page only makes sense if it appears in a frame, yet users somehow find the page in an unframed state. This particularly tends to happen when users find the page through a search engine. To give the reader a clue that this isn't the page where they should be, paste this Javascript at the top of the page, before any text:

this code produces this
<SCRIPT TYPE="text/javascript">
<!--
function checkframed(gourl)
{
if (top == self)
   document.write(
      '<DIV STYLE="padding:8pt;' + 
      'border-style:solid;border-width:8pt;' + 
      'border-color:66CC33;">' + 
      '<STRONG STYLE="font-size:30pt;' + 
      'font-weight:900;font-family:sans-serif">' + 
      'This page is intended as part of a ' + 
      '<A HREF="' + gourl + '">framed document</A>.' + 
      '</STRONG></DIV>');
}

checkframed("dgftop.php");

//-->
</SCRIPT>
this page

Change the URL in the last line to the URL of the frameset page. For example, if you want people to go to myhomepage.php then set the last line like this:

checkframed("myhomepage.php");

This script checks to see if the current page is the "top" page (if (top == self)). If it is, it writes out a notice to the user that they would probably rather be at another page, and writes out a link to that page.

You might notice a small disparity between this method and the Don't Get Framed method. In this example the user is presented with a passive link if they are not on the intended web page. In the previous example, however, no permission is asked: the browser is automatically forwarded to the intended page. The reason for this difference lies in the slight difference in intentions between the two pages. The "Don't Frame Me" script is intended to act as a deterrence, to stop somebody else from framing the page. The best deterrence in this case is to unload their page without further ado. The "Do Frame Me" script, however, is not intended to act as a deterrence, only as a gentle reminder, so a gentler method of redirection is used.



Copyright 1997-2002 Idocs, Inc. Written by Miko Sullivan.

 
 
What is your major source of website traffic?
 
 
 
 
 
 

ADVERTISEMENT

 
Cheap Web HostingBudget Web HostingEcommerce Web Hosting
Link to UsLink ExchangeAdvertisePrivacy PolicyTerms Of ServiceAbout UsContact UsSitemap
Copyright © 2006 - 2008 Broadband Media, Inc. All rights reserved.