Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image wont change... !!! (asp and javascript)

Status
Not open for further replies.

McKaulick

Programmer
Oct 24, 2002
35
AR
Ok, I have a asp function that occur everytime a page is loading! In this function I change a Session with a link corresponding to the page where the user is! And then I want to write this adress on the top frame so the user has some kind of navigator! But I need each time to refresh the top frame so the adress changes!

Ok, here's my problem! So first the asp function is triggered and then on page onload I call a javascript function that verify wich page I am and then I'm changing the page's title image. But before that I refresh the top frame and then I'm changing the image! If I don't refresh the top frame the image is changing! But If I do the refresh the image is not changing!

HERE's some code:

function changeImg(pageName)
{
top.topDown.location.reload();

switch (pageName)
{
case 'main':
imgMain = new Image();
imgMain.src = "images/accueil.jpg";
parent.topDown.document.logo.src = imgMain.src;
break

case 'altao':
imgAltao = new Image();
// alert ("someText")// If I put that, the image change
imgAltao.src = "../images/societe.jpg";
parent.topDown.document.logo.src = imgAltao.src;
break

case 'equipe':
imgName.src = "../images/equipe.jpg";
parent.topDown.document.logo.src = imgName.src;
break
}

Thanks in advance!
 
If this is an asp page, shouldnt it be possible to set the image thru asp itself,the way you are setting the link of the page?
 
That's cool! It's was actually the best thing to do! And I thought about it yesterday before falling asleep and then you this morning your answer came up to me!

Thanks for your help!

:eek:)

MC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top