I'm no dom wizard, so I just used a method I have used in the past. However, I will try assigning an id to the image.
thanks > From: "Ben Joyce" <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Thu, 13 Mar 2003 17:46:21 -0000 > To: [EMAIL PROTECTED] > Subject: [wdvltalk] RE: javascript help needed > > How come you're using getElementByID() in other places but not when you > assign the image it's new src? > > Is that anything to do with it? > >> -----Original Message----- >> From: Steve Miller [mailto:[EMAIL PROTECTED] >> Sent: 13 March 2003 17:44 >> To: [EMAIL PROTECTED] >> Subject: [wdvltalk] RE: javascript help needed >> >> >> This one: >> document.im_num.src="../graphics/gold.gif"; >> >>> From: "Ben Joyce" <[EMAIL PROTECTED]> >>> Reply-To: [EMAIL PROTECTED] >>> Date: Thu, 13 Mar 2003 17:38:53 -0000 >>> To: [EMAIL PROTECTED] >>> Subject: [wdvltalk] RE: javascript help needed >>> >>> What line is the error on? >>> >>>> -----Original Message----- >>>> From: Steve Miller [mailto:[EMAIL PROTECTED] >>>> Sent: 13 March 2003 17:32 >>>> To: [EMAIL PROTECTED] >>>> Subject: [wdvltalk] javascript help needed >>>> >>>> >>>> I am using php and javascript together on a page. I am trying to >>>> change an image source by sending a dynamically-generated >> image name >>>> to a script. An alert in the script is indicating that I >> am sending >>>> the correct image name, but I get an error that >> "document.im_num is >>>> not an object". >>>> >>>> How do I write the javascript to accept the image name I >> am sending? >>>> >>>> Thanks! >>>> steve miller >>>> >>>> >>>> >>>> function loadAd(url,im_num) >>>> { >>>> alert(im_num); >>>> if (document.all) >>>> { >>>> targetAll=eval(window.frames["display"].location) >>>> targetAll.href=url; document.im_num.src="../graphics/gold.gif"; >>>> } >>>> else if (document.getElementById&&!document.all) >>>> { >>>> targetElement=eval(document.getElementById("display")) >>>> targetElement.src=url; >>>> document.im_num.src="../graphics/gold.gif"; >>>> } >>>> } >>>> >>>> >>>> onclick=\"loadAd('$ad_style[$n]?ad_number=$ad_number[$n]','ima >>>> ge$n')\" >>>> > ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
