# Onrelease question

**URL:** <https://forum.kirupa.com/t/onrelease-question/15430>\
**Category:** Uncategorized\
**Created:** [March 14, 2003, 2:55am UTC](https://forum.kirupa.com/t/onrelease-question/15430 "2003-03-14T02:55:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![theworldinside](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@theworldinside](https://forum.kirupa.com/u/theworldinside)\
**Post date:** [March 14, 2003, 2:55am UTC](https://forum.kirupa.com/t/onrelease-question/15430/1 "2003-03-14T02:55:26Z")

</div>

how can i make it so when someone clicks on a link, it loads the page in one iframe and changes the image in another?

---

<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:** [March 14, 2003, 4:10am UTC](https://forum.kirupa.com/t/onrelease-question/15430/2 "2003-03-14T04:10:39Z")

</div>

Just add two getURLS that change the content of each iframe.

[AS]on (release){  
getURL(“content1.html”, “iframeName1”);  
getURL(“content2.html”, “iframeName2”);  
}[/AS]

---

<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:** [March 14, 2003, 4:12am UTC](https://forum.kirupa.com/t/onrelease-question/15430/3 "2003-03-14T04:12:56Z")

</div>

I’m not sure they mean in Flash…

---

<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:** [March 14, 2003, 4:14am UTC](https://forum.kirupa.com/t/onrelease-question/15430/4 "2003-03-14T04:14:45Z")

</div>

Ah, I got to this thread through the new posts area, so I didn’t notice the section it was in.

In that case… You could probably set up a javascript function.

::gets to testing::

[edit]::wonders why the title says onrelease then::[/edit]

---

<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:** [March 14, 2003, 4:32am UTC](https://forum.kirupa.com/t/onrelease-question/15430/5 "2003-03-14T04:32:02Z")

</div>

Alright I came up with a Javascript way…

Insert this code in between your \<HEAD\>\</HEAD\> tags of your HTML file.

```php
<SCRIPT LANGUAGE="JavaScript">
<!--
function changeBoth(win1Loc, win2Loc){
document.all.window1.src = win1Loc;
document.all.window2.src = win2Loc;
}
-->
</SCRIPT>

```

Now you can call the function like this…

```php
<A HREF="JavaScript:void(0);" onClick="JavaScript:changeBoth('win1NewFile.html', 'win2NewFile.html')">Change Both</A>

```

[EDIT]WHY DOES IT KEEP CHANGING JAVASCRIPT TO ABOUT?!?!?!?!?![/EDIT]

---

<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:** [March 14, 2003, 5:14am UTC](https://forum.kirupa.com/t/onrelease-question/15430/6 "2003-03-14T05:14:33Z")

</div>

Ok Ok, OF COURSE there has to be Netscape complications :sure:

I fixed that though. Since iframes are only supported by Netscape 6+ I went through the liberty of only browser checking for IE or NS6+, then calling different scripts.

```php
<SCRIPT LANGUAGE="JavaScript">
<!--
function changeBoth(win1Loc, win2Loc){
var IE = document.all;
var NS = !document.all && document.getElementById;
if (IE) {
  document.all.window1.src = win1Loc;
  document.all.window2.src = win2Loc;
} else if (NS) {
  frames['window1'].location.href = win1Loc;
  frames['window2'].location.href = win2Loc;
}

}
-->
</SCRIPT>

```

That is the new script.

And Oh yeah, I forgot. This script assumes your Iframe names are window1 and window2.

This script SHOULD work in IE4+ and NS6+, but I never guarantee anything 😉

Well, if you indeed did mean in Flash as my first post… then oh well, maybe this will help someone else out 😛

---

<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:** [March 14, 2003, 5:58pm UTC](https://forum.kirupa.com/t/onrelease-question/15430/7 "2003-03-14T17:58:18Z")

</div>

> \*Originally posted by lostinbeta \*  
> \*\*Ok Ok, OF COURSE there has to be Netscape complications :sure: \*\*

That’s exactly why I HATE using JavaScript, essentially you have to code everything twice. 😠

---

<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:** [March 14, 2003, 6:02pm UTC](https://forum.kirupa.com/t/onrelease-question/15430/8 "2003-03-14T18:02:41Z")

</div>

> \*Originally posted by abzoid \*  
> \*\*That’s exactly why I HATE using JavaScript, essentially you have to code everything twice. 😠 \*\*

Yeah, but it is the price to pay to be a scripter. I like what I do, even though I sometimes have to code for both browsers seperately. 😛
