Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Displaying images from the local machine, jscript

views
     
TSnazo
post Mar 7 2006, 03:32 PM, updated 20y ago

Getting Started
**
Junior Member
107 posts

Joined: Nov 2005
From: Kât Lởng Po


Let`s say in my web page i have a tag like this

CODE

<img src="pic.gif" onClick="this.src='http://www.somewebsite.com/image.gif';"/>


this will mean that when the user clicks pic.gif, it wil change to image.gif from www.somewebsite.com

Now let`s say i change it to something like this

CODE

<img src="pic.gif" onClick="this.src='c:\image.gif';"/>


As u can see, the new picture is now from the local machine. I tried this. It does not work. How come i cannot change the image to a picture from the local machine. More importantly, Is this even possible to do this at all?

Oh btw, if u do something like this,

CODE

<img src="c:\pic.gif" />


it wil work. So it seems that only the initial image can be from the local machine huh huh.gif
fly
post Mar 7 2006, 04:17 PM

¯\(°_o)/¯
Group Icon
VIP
1,119 posts

Joined: Jan 2003
Why are you using local drive names and paths in your HTML? It's bad bad bad bad bad practice.
TSnazo
post Mar 7 2006, 06:38 PM

Getting Started
**
Junior Member
107 posts

Joined: Nov 2005
From: Kât Lởng Po


haha...i know i`s bad. but it was done during the testing phase of the application. I not i wouldn`t hv noticed the behaviour. So now the question is how come the browser doesn`t know how to retrive the image from the local drive......
wKkaY
post Mar 7 2006, 07:04 PM

misutā supākoru
Group Icon
VIP
6,008 posts

Joined: Jan 2003
It can, but it won't because of the browser security policies. Check your Internet Explorer settings - you might get it to work after twiddling with it. Proceed with caution.

 

Change to:
| Lo-Fi Version
0.0155sec    1.42    5 queries    GZIP Disabled
Time is now: 25th December 2025 - 12:07 AM