jaymc Posted January 17, 2007 Share Posted January 17, 2007 I need a script that will check to see if a webpage is sitting in an IFRAME, if it isnt, take them to my homepageBasically, to stop people asking pages directly rather than through my iframeHope someone can helpHave tried a few scripts but they only with with actual Framesets and not IFRAMESCheers Link to comment https://forums.phpfreaks.com/topic/34511-page-nested-in-frame/ Share on other sites More sharing options...
mainewoods Posted January 17, 2007 Share Posted January 17, 2007 you can access the src element of your iframe like this:[code]if (document.getElementById('iframeid').src == 'yourpageurl') { // true code} else { // false code}[/code] Link to comment https://forums.phpfreaks.com/topic/34511-page-nested-in-frame/#findComment-162851 Share on other sites More sharing options...
nogray Posted January 17, 2007 Share Posted January 17, 2007 just google "breakout of frame" and you'll find some usefull script. Alter them to do what you need. Link to comment https://forums.phpfreaks.com/topic/34511-page-nested-in-frame/#findComment-163235 Share on other sites More sharing options...
mainewoods Posted January 18, 2007 Share Posted January 18, 2007 This page tells you how to do what you want:http://www.howtocreate.co.uk/tutorials/javascript/browserinspecific--about a third way down that page Link to comment https://forums.phpfreaks.com/topic/34511-page-nested-in-frame/#findComment-163764 Share on other sites More sharing options...
jaymc Posted January 21, 2007 Author Share Posted January 21, 2007 Ive tried that and it still didnt workIsnt that related to framesets rather than IFRAMESHas anyone got any WORKING code that has been tested?Cheers Link to comment https://forums.phpfreaks.com/topic/34511-page-nested-in-frame/#findComment-165288 Share on other sites More sharing options...
fenway Posted January 22, 2007 Share Posted January 22, 2007 Most people don't break out of iframes... Link to comment https://forums.phpfreaks.com/topic/34511-page-nested-in-frame/#findComment-166660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.