# Where to put javascript

**URL:** <https://forum.kirupa.com/t/where-to-put-javascript/26786>\
**Category:** Uncategorized\
**Created:** [July 26, 2003, 9:07am UTC](https://forum.kirupa.com/t/where-to-put-javascript/26786 "2003-07-26T09:07:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![urbaneve](https://avatars.discourse-cdn.com/v4/letter/u/839c29/32.png) [@urbaneve](https://forum.kirupa.com/u/urbaneve)\
**Post date:** [July 26, 2003, 9:07am UTC](https://forum.kirupa.com/t/where-to-put-javascript/26786/1 "2003-07-26T09:07:01Z")

</div>

i know this is a real silly question – but here it goes anyway:

when using a po-up window – do you put the script in the html of main page or in the page of what is supposed to be the popup window?

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 10:02am UTC](https://forum.kirupa.com/t/where-to-put-javascript/26786/2 "2003-07-26T10:02:22Z")

</div>

On your main page.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2003, 10:34am UTC](https://forum.kirupa.com/t/where-to-put-javascript/26786/3 "2003-07-26T10:34:23Z")

</div>

You always put the javascript in the window that it is being loading/written/processed from. Think about it logically, you cannot create a pop-up window from inside the window that you want to pop-up.

I hope this doesn’t confuse you more.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 28, 2003, 12:53pm UTC](https://forum.kirupa.com/t/where-to-put-javascript/26786/4 "2003-07-28T12:53:27Z")

</div>

okay – that’s what i thought, but for some reason, i am having trouble getting them to work. from what i am looking at – it looks right, but… (hmmm – back to the drawing board)

thanks guys – 🙂
