Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Loading client-side images for use in Javascript

Reply
Thread Tools

Re: Loading client-side images for use in Javascript

 
 
Vidar Petursson
Guest
Posts: n/a
 
      07-18-2003
Hi

var imgDown = new Image();
imgDown.src = "PATH/Image.gif";

setNewImg(e){
e.src = imgDown.src;
}

<img onclick="setNewImg(this)">

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> I did post this a short while back and received a couple of answers but

I'm
> still stuck. What I've done is pasted the source below. This is what

appears
> in my html document when the source is viewed.
>
> <script>
> var imgdown = new Image;
> imgdown.src = 'C:\Inetpub\wwwroot\testapp\Images\down.gif';
> </script>
>
> Later on, if a user clicks on an area, some Javascript runs and it

attempts
> to replace that same area with the 'pre-populated' imgdown image object

but
> nothing shows.
>
> The path to the image is correct. What am I doing wrong here?
>
> Regards
> John.
>
>



 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      07-18-2003
Hi Vidar,

Please excuse the ignorance but what should I use in the 'PATH' part? The
stringbuilder section where I write the javascript text is from within a
user control which is in another folder off the web root.

Regards
John.


"Vidar Petursson" <(E-Mail Removed)> wrote in message
news:#wg$#(E-Mail Removed)...
> Hi
>
> var imgDown = new Image();
> imgDown.src = "PATH/Image.gif";
>
> setNewImg(e){
> e.src = imgDown.src;
> }
>
> <img onclick="setNewImg(this)">
>
> --
> Best Regards
> Vidar Petursson
> ==============================
> Microsoft Internet Client & Controls MVP
> ==============================
> "John" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi all,
> >
> > I did post this a short while back and received a couple of answers but

> I'm
> > still stuck. What I've done is pasted the source below. This is what

> appears
> > in my html document when the source is viewed.
> >
> > <script>
> > var imgdown = new Image;
> > imgdown.src = 'C:\Inetpub\wwwroot\testapp\Images\down.gif';
> > </script>
> >
> > Later on, if a user clicks on an area, some Javascript runs and it

> attempts
> > to replace that same area with the 'pre-populated' imgdown image object

> but
> > nothing shows.
> >
> > The path to the image is correct. What am I doing wrong here?
> >
> > Regards
> > John.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image loading using javascript. Handling timeouts and parrallel loading under IE zborisau@gmail.com Javascript 4 08-28-2005 02:02 PM
Javascript Loading Images Robbie Javascript 1 06-04-2004 09:12 AM
delayed loading of images possible in javascript? stan k. Javascript 3 02-05-2004 12:18 AM
mousewheel scrolling stops when loading images via javascript MrMr[iCE] Javascript 0 08-10-2003 02:48 AM
Re: Loading client-side images for use in Javascript j0vo ASP .Net 2 07-19-2003 03:21 AM



Advertisments