redletterrocko
Programmer
Alright, I'm currently implementing some pages inside IFRAMEs and have been trying to write some code that does not allow the page to be viewed outside of an IFRAME. This is what I've gotten so far:
Code:
<script>
<!--
if (top==self) {
document.write('<hr size=7 color=red><strong style="font-family:verdana;font-size:130%">');
document.write('ERROR: This page is intended to be inside an IFRAME!');
document.write('Please visit <a href="[URL unfurl="true"]http://eventuallyanyway.com">Eventually[/URL] Anyway</a> to see the actual page.');
document.write('</strong></hr>');
}
// -->
</script>
[code]
I'm not super experienced with javascript, but would like to implement another part of the script that makes sure it's part of the IFRAME, and then uses document.write to write the actual page. Is that possible? I would rather these pages not be viewable from an IFRAME, and lots of times, Google tends to screw things up and use those pages in its search, instead of the actual page.