Ask a Question related to ASP.NET General, Design and Development.
-
j0vo #1
Re: Loading client-side images for use in Javascript
Ok, I'll play the dumb guy.... if your script is running on the server under
the testapp application, why isn't the source 'Images/down.gif' (Path
relative) to the application and the full path on the server? At least if
nothing else, this would make the code more transportable to serveral hosts
without having to rely on the fact that inetpub/wwwroot is the actual root
of the web server (which it is not on my machines).
Cheers
"John" <a@b.com> wrote in message
news:e91gP9STDHA.560@TK2MSFTNGP10.phx.gbl...I'm> Hi all,
>
> I did post this a short while back and received a couple of answers butappears> still stuck. What I've done is pasted the source below. This is whatattempts> 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 itbut> to replace that same area with the 'pre-populated' imgdown image object> nothing shows.
>
> The path to the image is correct. What am I doing wrong here?
>
> Regards
> John.
>
>
j0vo Guest
-
Client-Side Validation of asp:TextBox with Javascript
Hi - I'm trying to do client-side validation of the text in a Asp.Net textbox control using javascript. My page has the following: <form... -
problem Calling webservice from client side javascript
I have a problem calling webservice from client side javascript. The javascript call the settimeout() method. when the user press submit button it... -
Hit Counter in Javascript on client side.
Have opportunity to use free web server space but can only use client scripting. How to code hit counter in javascript? Any help would be... -
Loading Image on the Server/Client side ?
Dear experts, I have made a Flash slide show which shows all the images within a particular folder one by one and repeatedly. There are total... -
how can i add client side javascript to a web user control?
hi, i have a web user control that i wish to add some client-side javascript to. something like this: onChange="javascript:DoSomething();" ... -
John #2
Re: Loading client-side images for use in Javascript
Hi,
I did actually try "..\Images\down.gif" and "Images/down.gif" and both don't
work for me. WHat now?
Regards
John.
"j0vo" <nospamjovo@eostar.com> wrote in message
news:eynpWHTTDHA.3116@TK2MSFTNGP10.phx.gbl...under> Ok, I'll play the dumb guy.... if your script is running on the serverhosts> the testapp application, why isn't the source 'Images/down.gif' (Path
> relative) to the application and the full path on the server? At least if
> nothing else, this would make the code more transportable to serveral> without having to rely on the fact that inetpub/wwwroot is the actual root
> of the web server (which it is not on my machines).
>
> Cheers
>
> "John" <a@b.com> wrote in message
> news:e91gP9STDHA.560@TK2MSFTNGP10.phx.gbl...> I'm> > Hi all,
> >
> > I did post this a short while back and received a couple of answers but> appears> > still stuck. What I've done is pasted the source below. This is what> attempts> > 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> but> > to replace that same area with the 'pre-populated' imgdown image object>> > nothing shows.
> >
> > The path to the image is correct. What am I doing wrong here?
> >
> > Regards
> > John.
> >
> >
>
John Guest
-
Vidar Petursson #3
Re: Loading client-side images for use in Javascript
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" <a@b.com> wrote in message
news:e91gP9STDHA.560@TK2MSFTNGP10.phx.gbl...I'm> Hi all,
>
> I did post this a short while back and received a couple of answers butappears> still stuck. What I've done is pasted the source below. This is whatattempts> 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 itbut> to replace that same area with the 'pre-populated' imgdown image object> nothing shows.
>
> The path to the image is correct. What am I doing wrong here?
>
> Regards
> John.
>
>
Vidar Petursson Guest
-
John #4
Re: Loading client-side images for use in Javascript
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" <theking@icysoft.com> wrote in message
news:#wg$#vTTDHA.632@TK2MSFTNGP12.phx.gbl...> 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" <a@b.com> wrote in message
> news:e91gP9STDHA.560@TK2MSFTNGP10.phx.gbl...> I'm> > Hi all,
> >
> > I did post this a short while back and received a couple of answers but> appears> > still stuck. What I've done is pasted the source below. This is what> attempts> > 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> but> > to replace that same area with the 'pre-populated' imgdown image object>> > nothing shows.
> >
> > The path to the image is correct. What am I doing wrong here?
> >
> > Regards
> > John.
> >
> >
>
John Guest
-
j0vo #5
Re: Loading client-side images for use in Javascript
I did not see your prior posts, but if the script is on the executing on
the web server in the context of the app, then things should be cool with
path absolute or relative. But your subject line indicates that perhaps the
script is a client-side script running in the browser. If it is a script
running in the browser, then I would not ever expect path relative or
absolute addressing from the client script to ever be able to directly
access a file on the web server like you have it.
Instead, I would imagine the .NET aspx to script something like
string newPath = Request.Application.Path + "/images/down.gif";
where the above body is specified in a runat=server block of code -- so that
the application path can be rewritten by the web server so that the client
browser can load it via URL.
That is my guess, not knowing anything about your application -- Hope it
helps, good luck
"John" <a@b.com> wrote in message
news:OcQiOnTTDHA.1688@TK2MSFTNGP11.phx.gbl...don't> Hi,
>
> I did actually try "..\Images\down.gif" and "Images/down.gif" and bothif> work for me. WHat now?
>
> Regards
> John.
>
> "j0vo" <nospamjovo@eostar.com> wrote in message
> news:eynpWHTTDHA.3116@TK2MSFTNGP10.phx.gbl...> under> > Ok, I'll play the dumb guy.... if your script is running on the server> > the testapp application, why isn't the source 'Images/down.gif' (Path
> > relative) to the application and the full path on the server? At leastroot> hosts> > nothing else, this would make the code more transportable to serveral> > without having to rely on the fact that inetpub/wwwroot is the actualbut> > of the web server (which it is not on my machines).
> >
> > Cheers
> >
> > "John" <a@b.com> wrote in message
> > news:e91gP9STDHA.560@TK2MSFTNGP10.phx.gbl...> > > Hi all,
> > >
> > > I did post this a short while back and received a couple of answersobject> > I'm> > appears> > > still stuck. What I've done is pasted the source below. This is what> > attempts> > > 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> > > to replace that same area with the 'pre-populated' imgdown image>> > but> >> > > nothing shows.
> > >
> > > The path to the image is correct. What am I doing wrong here?
> > >
> > > Regards
> > > John.
> > >
> > >
> >
>
j0vo Guest



Reply With Quote

