/    Sign up×
Community /Pin to ProfileBookmark

Multiloading

Hi guys, I’m in the need for a script which when a link is activated, it changes a document in an IFRAME, AND changes an “image” on the same page where the link is at.

The design of the page, has a space above the IFRAME, and a menu beneath the IFRAME. When clicking on a link in the menu, the titlte (“image” place in the space above the IFRAME) changes and the page inside the IFRAME changes.

Is this possible, and could somebody help me with this problem?

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@ray326Dec 02.2003 — In the onclick handler for that menu item just change the src of the iframe and the src for the img. Give each an id and use document.getElementById() to access them.
Copy linkTweet thisAlerts:
@raiderauthorDec 02.2003 — Hi, could you please specify the scriptcode. Can't find where to place it another code I have.

Thanks... ?
Copy linkTweet thisAlerts:
@ray326Dec 02.2003 — <i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;img/iframe demo&lt;/title&gt;
&lt;/head&gt;
&lt;style type="text/css"&gt;
img {display: block;}
&lt;/style&gt;
&lt;script language="Javascript"&gt;
function setsource(image, loc)
{
document.getElementById("topimage").src=image;
document.getElementById("topframe").src=loc;
}
&lt;/script&gt;
&lt;body&gt;

&lt;img id="topimage" src="http://forums.webdeveloper.com/img/webdevlogoz.gif" /&gt;
&lt;iframe id="topframe" src="http://www.webdeveloper.com/"&gt;&lt;/iframe&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href='javascript:setsource("http://forums.webdeveloper.com/img/webdevlogoz.gif","http://www.webdeveloper.com/")'&gt;WebDeveloper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='javascript:setsource("http://developer.java.sun.com/images/v4_java_logo.gif","http://developer.java.sun.com/")'&gt;Java Developer Connection&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;

[b]NOTE: this BBS has munged the above code. In the href it should be javascript not java script! :mad: [/b]
Copy linkTweet thisAlerts:
@raiderauthorDec 02.2003 — Thanks again, ray326. The code looks correct, but when the link is activated, it returns a blank page.

I've inserted the code in my website, I you want to take a look.

http://www.geocities.com/divineyeti/
Copy linkTweet thisAlerts:
@ray326Dec 02.2003 — For some reason this stupid BBS munged the code when I pasted it in. Replace [b]java script[/b] with [b]javascript[/b] and it will work as advertised.
Copy linkTweet thisAlerts:
@raiderauthorDec 02.2003 — Seems to work now, thank you very much. Saved my day ?
×

Success!

Help @raider spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...