Click to See Complete Forum and Search --> : slashes vanish in image


IsmAvatar
01-10-2004, 06:44 PM
Best I could do for a title.

I'm writing up this code that's supposed to display an image on the screen while within JavaScript.
The problem is that I refer to the image from within my computer, because I like to test out my webpage before I upload it. Sometimes I store things in subfolders so things aren't cluttered. The problem arrises when I try to refer to an image from within a subfolder.

document.write("<img src='C:\My Documents\d6.bmp'>")
The above code, while within javascript, is supposed to display the image d6.bmp, located at C:\My Documents\d6.bmp
but instead, the page shows up with a missing picture block (the one with the X in it). I look at it's properties and it says that it's displaying image C:My%20Documentsd6.bmp
so it's obviously removing the backslashes. Any clue how to work this out?

ray326
01-10-2004, 06:59 PM
I believe you'll find "C:\My Documents\d6.bmp" to command.com has a url of

file:///c|/My%20Documents/d6.bmp

I've also seen file:///c:/My%20Documents/d6.bmp work.

IsmAvatar
01-10-2004, 07:27 PM
that first one did the trick. thanks a bunch. I'd seen that before, now I know what it's for.