therealwesfoster Posted March 19, 2008 Share Posted March 19, 2008 I have 2 frames. TOP and HOME Sometimes the top frame gets removed by accident. I'm needing a short JS script that checks "if TOP frame doesn't exist, redirece to index.html" Which I would think would be like: if (!window.parent.top) { document.location.href = "index.html"; } But it don't work. Help please. Thanks Link to comment https://forums.phpfreaks.com/topic/96977-check-if-frame-exists/ Share on other sites More sharing options...
therealwesfoster Posted March 19, 2008 Author Share Posted March 19, 2008 Well, i ended up doing this: if (self != top) { document.location.href = "./index.html"; } Works just the same SOLVED (although, if you have an answer to my question, feel free to post it. I like learning new things) Link to comment https://forums.phpfreaks.com/topic/96977-check-if-frame-exists/#findComment-496383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.