# Any javascript gurus?

**URL:** <https://boards.straightdope.com/t/any-javascript-gurus/258734>\
**Category:** Factual Questions\
**Created:** [August 7, 2004, 4:46am UTC](https://boards.straightdope.com/t/any-javascript-gurus/258734 "2004-08-07T04:46:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OpalCat](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@OpalCat](https://boards.straightdope.com/u/OpalCat)\
**Post date:** [August 7, 2004, 4:46am UTC](https://boards.straightdope.com/t/any-javascript-gurus/258734/1 "2004-08-07T04:46:08Z")

</div>

I have a page that has a page embedded in it using the iframe tag. I need to make sure that the whole thing is loaded, so I need some code that will detect if the page is inside the frame or not, and if it isn’t, reload itself with the frames page.

I very rarely use frames as I think they are usually a bad idea, but in this case it needs to be that way. I’m just afraid that people are going to start linking directly to the internal page and that would be bad, m’kay?

Unfortunately I know about as much about javascript as my cat does, and I already asked him (he didn’t know)…

😕

---

<div class="post-metadata">

**Author:** ![Q.E.D](https://avatars.discourse-cdn.com/v4/letter/q/51bf81/32.png) [@Q.E.D](https://boards.straightdope.com/u/Q.E.D)\
**Post date:** [August 7, 2004, 5:57am UTC](https://boards.straightdope.com/t/any-javascript-gurus/258734/2 "2004-08-07T05:57:22Z")

</div>

[Here you go](http://scriptasylum.com/tutorials/frameredirect/frameredirect.html). You can just scroll down to the bottom and copy-and-paste the cvarious bits where they tell you to. You’ll need to modify the page names, of course. Hope this helps!

---

<div class="post-metadata">

**Author:** ![OpalCat](https://avatars.discourse-cdn.com/v4/letter/o/8edcca/32.png) [@OpalCat](https://boards.straightdope.com/u/OpalCat)\
**Post date:** [August 7, 2004, 6:33am UTC](https://boards.straightdope.com/t/any-javascript-gurus/258734/3 "2004-08-07T06:33:30Z")

</div>

Hooray! Thank you! That works perfectly! None of the examples I was googling up seemed quite right.  
_happy dance_
