matthew9090 Posted June 1, 2011 Share Posted June 1, 2011 i've got this javascript code <script type="text/javascript"> function show(str) { document.getElementById('div').innerHTML=str; } </script> and html code: <a href='http://link.com' onMouseOver="show('text')">text</a> <div id="div"> </div> i'm using the google chrome browser and it doesn't come up with anything. when i go to the inspect element on chrome it comes up with: index.php:103Uncaught TypeError: string is not a function. What does it mean! Link to comment https://forums.phpfreaks.com/topic/238078-simple-onmouseover-not-showing-anything/ Share on other sites More sharing options...
arbitter Posted June 1, 2011 Share Posted June 1, 2011 I copied the exact scripts you have and it works fine. You must have forgotton to include the js file? Link to comment https://forums.phpfreaks.com/topic/238078-simple-onmouseover-not-showing-anything/#findComment-1223583 Share on other sites More sharing options...
.josh Posted June 1, 2011 Share Posted June 1, 2011 all by itself, that works fine for me (even in Chrome). What else do you have on your page? I don't think that error has to do with this code. For one thing, I do not see "string" anywhere in that code, and the error is telling you that you are trying to make a call to a function called "string" and it doesn't exist. Link to comment https://forums.phpfreaks.com/topic/238078-simple-onmouseover-not-showing-anything/#findComment-1223585 Share on other sites More sharing options...
matthew9090 Posted June 2, 2011 Author Share Posted June 2, 2011 thanks for the replies but i fixed it now. i just change title to a different function name. Link to comment https://forums.phpfreaks.com/topic/238078-simple-onmouseover-not-showing-anything/#findComment-1223947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.