•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 425,826 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,980 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 753 | Replies: 1
![]() |
•
•
Join Date: Jun 2008
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
I am trying to create this code for my website but i am having trouble per when you click the button for corrosponding with correct image it does not on call take that image and show it as my main one i can not get my img swap to work and have been trying for hours and
<html> <body bgcolor= "#950606"> <body> <h3>first try at pic swap</h3> <form Name= theForm> <hr> <table border = 1> <tr> <td colspan= 3> <center> <img name = imgDisplay src= "C:\html\images/flamechick.jpg" height = 100 width = 100> </center> </tr> <tr> <td><img src= "C:\html/flamechick.jpg" height = 50 width = 50 name = "imgFlamechick"> </td> <td><img src= "C:\html/battle.jpg" height = 50 width = 50 name = "imgBattle"> </td> <td><img src= "C:\html/meandsnake.jpg" height = 50 width = 50 name = "imgMeandsnake"> </td> </tr> <tr> <td><input type="button" value="Flamechick" onClick= "showFlamechick()"> </td> <td><input type="button" value="Battle" onClick= "showBattle()"> </td> <td><input type="button" value="Me and Snake" onClick= "showMeandsnake()"> </td> </tr> </table> </form> </body> </html>
Last edited by ~s.o.s~ : Jul 2nd, 2008 at 1:01 am. Reason: Added code tags, learn to use them.
•
•
Join Date: Apr 2005
Location: New York state
Posts: 468
Reputation:
Rep Power: 5
Solved Threads: 71
Firstly, remember that those are absolutely links meaning if that page goes anywhere besides your machine those images are broken. Secondly, to maintain cross-browser compatibility
onClick should be onclick . Finally, you don't actually have any Javascript there for us to debug ( When you post the code please use code tags ) GCS d- s+:+ a-->? C++(++++) UL+++ P+>+++ L+++ !E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r z+*
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r z+*
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Java and IE7
- Next Thread: Playstation 3 friends


Linear Mode