Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i change the source of a image in Netscape 4 o later? 1

Status
Not open for further replies.

majg2002

Programmer
Jul 11, 2000
8
0
0
ES
The follow work in I.Explorer 5.0 but in Netscape fail<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document[nameImage].src = &quot;file://c:/images/man.gif&quot;<br><br>where nameImage is the name of a tag image within a form.<br>This code work in I.Explorer 5.0<br>How is for Netscape??????????'<br><br>I need help.
 
Try using <br>document.images[&quot;nameImage&quot;].src=&quot;FileName&quot;<br><br>I don't know it's right, but try it.<br><br>Bye!
 
<br>document.nameImage.src = &quot;file://c:/images/man.gif&quot;<br>&nbsp;<br>should work in IE&nbsp;&nbsp;and Netscape <br><br>A better way is to use the following but make sure your directory structure is set up right.&nbsp;&nbsp;ie, your images should be in a directory called &quot;images&quot; located in the directory that contains your HTML file.<br><br>document.nameImage.src = &quot;images/man.gif&quot;<br><br>This method will still work when you put your files on the server. <p>Ray Stott<br><a href=mailto: > </a><br><a href= Mall for Webmasters</a><br>
 
Try not to use absolute URL's when working off of the file system... if you ever plan to port to the web, they definitely won't work, and different browsers might parse them differently... <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Thank for your answer and excuse my english, i'm spanish.<br><br>I forgot to tell in my question a thing, the images are in the Client and the page in the server. The code is correct because in I.Explorer 5.0 work.<br>I need to change the source to a local image(is in the client)
 
Thank for your answer and excuse my english, i'm spanish.<br><br>I forgot to tell in my question a thing, the images are in the Client and the page in the server. The code is correct because in I.Explorer 5.0 work.<br>I need to change the source to a local image(is in the client) <br><br>Note:I'm sure my directory structure is set up right because it works in I.Explorer 5.0. Too this code work in Netscape when the image is in the server, but if i try to change the source to a local image, then Netscape fails.<br><br>Please, I need help about:<br>document.nameImage.src = &quot;file://c:/images/man.gif&quot;
 
for this question you need to specify &quot;client&quot;. You mean the images are cached, or they reside on the hard drive? And have you tried using relative path names instead of absolute path names? <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Relative path is no use at all, because would search in the server. Where and how specify i &quot;client&quot;?<br>
 
depends on where the page resides... <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
The pages resides in the server and the images in the client...
 
I suspect this is the problem:<br><br>the<br>document.image.src <br>property will work correctly for either NS4 or IE4+ HOWEVER<br><br>if you are using layers you will also have to identify which layer the image resides on for netscape.&nbsp;&nbsp;ie:<br><br>document.layername.document.image.src
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top