tarun Posted April 3, 2007 Share Posted April 3, 2007 This Is My HTML <a href='' onMouseover=document.write('<img src=img.jpg>') ''>Hover Mouse Here</a> And It Doesn't Work I Get The Error "Unterminated string constant" Can AnyBody Help Me Please Thnx, Tarun Quote Link to comment Share on other sites More sharing options...
desithugg Posted April 4, 2007 Share Posted April 4, 2007 what exactly are you trying to do by adding <img src=img.jpg> Quote Link to comment Share on other sites More sharing options...
desithugg Posted April 4, 2007 Share Posted April 4, 2007 are you trying to change images on mouse hover than try <head> <script language='javascript'> if (document.images) { poth00=new Image poth00.src='http://url.net/image1.png' poth01=new Image poth01.src='http://url.net/image2.png' }</script> </head> <img name='poth' src='default image url here'> <a href='#' onmouseover='document.poth.src=poth01.src' onmouseout='document.poth.src=poth00.src'>hover mouse here</a> Quote Link to comment Share on other sites More sharing options...
tarun Posted April 5, 2007 Author Share Posted April 5, 2007 No I Want It Document.Write An Image But It Doesn't Work Its For A Profile Using BBCode [url='' onMouseover=document.write('<img src=img.jpg>') '']Hover Here[/url] Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted April 5, 2007 Share Posted April 5, 2007 This Is My HTML <a href='' onMouseover=document.write('<img src=img.jpg>') ''>Hover Mouse Here</a> And It Doesn't Work I Get The Error "Unterminated string constant" Can AnyBody Help Me Please Thnx, Tarun <a href='' onMouseover="document.write('<img src=\'img.jpg\'>')">Hover Mouse Here</a> You need quotes around the HTML attributes. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted April 5, 2007 Share Posted April 5, 2007 <a href='' onMouseover="document.write('<img src=\'img.jpg\'>')">Hover Mouse</a> the code above will overwrite the entire browser window with the image in ie. In ff it will overwite the window as well but will keep displaying the hourglass as if it's never loaded. Is that what you wanted? Instead maybe try this: <a href="#" onMouseover="document.getElementById('someDIVid').innerHTML = '<img src=\"img.jpg\">';">Hover Mouse</div> --will display the image within the div with the specified id Quote Link to comment Share on other sites More sharing options...
tarun Posted April 6, 2007 Author Share Posted April 6, 2007 Cool Cool Topic Solved...? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.