EnCoCo Services

Tech Tips

Tips for and against frames

This forces your page out of any frame and displays it properly. This code is good for pages, which are not to be displayed in any frame.

<SCRIPT LANGUAGE="JavaScript">
  
   <!--
       if(top.frames.length > 0) { top.location.href=self.location; }
    //-->

</SCRIPT>

This forces your page out of any frame and displays the entry page of your domain.

<SCRIPT LANGUAGE="JavaScript">

<!--
       if(top.frames.length > 0) { top.location.href="/"; }
//-->

</SCRIPT>

This forces your (in) frame pages into your frame set page. Use pathname as parameter to enable a simple security feature in your frame set definition page (index.html), because there you can limit usage to local pages. You can also just jump to your front page, by setting top.location.href="/";.

<SCRIPT LANGUAGE="JavaScript">

<!--
       if(top.frames.length > 0) {                    // top is frame set
         if (top.location.host != window.location.host) {// frame set isn't ours
           top.location.href='/index.html?'+self.location.pathname;
         }
       } else {                                        // top is not a frame set
         top.location.href='/index.html?'+self.location.pathname;
       }
//-->

</SCRIPT>

Put this into your frame set definition page (index.html) inside the frame set definition and replace defaultpage.html (2x) with one of your pages. Check for colon in parameter makes sure its a local page request.

<SCRIPT LANGUAGE="JavaScript">

<!--//

d = "defaultpage.html";

s = GetParameter(d); 

i=s.indexOf(':'); 
 // if there is a colon, then this is not our page or locally on a PC
if (i != -1 ) {
  document.write('<FRAME SRC=\"'+s+'">');
} else {
  document.write('<FRAME SRC=\"'+d+'">');
}

//-->

</SCRIPT>
<NOSCRIPT>

<FRAME src="defaultpage.html">

</NOSCRIPT>

This function returns the parameter given behind the "?" of the URL and if there is none then it returns the value of d.

<SCRIPT LANGUAGE="JavaScript">

<!--//
function GetParameter(d)
 {
   s=top.location.href;
   i=s.indexOf('?');
   if (i != -1) {s=s.substr(i+1,s.length-1);} else {s=d;}
   return s;
 }

//-->

</SCRIPT>


Image Investigator

Organize your photos with the help of our Image Investigator. Search your image library for similar images or retrieve images by painting a sample. Look if you have duplicates in your image library.

Copyright 2008 © EnCoCo - All Rights Reserved