therschbach Posted April 10, 2009 Share Posted April 10, 2009 I hope I can explain my problem without it being too confusing.I have my index page pointing to an external javascript file. Two of these functions flip a picture back and forth when a mouse hovers over & off of the picture. I know for certain the function works. Here is the image html... <img class="left" src="http://i20.photobucket.com/albums/b202/therschbach/050908washobverse.jpg" onMouseOver="reverse(this)" onMouseOut="obverse(this)"> The javascript... function reverse(image){ var address = (image.src); address = address.replace(/obverse/,"reverse"); image.src = address;}function obverse(image){ var address = (image.src); address = address.replace(/reverse/,"obverse"); image.src = address;} The problem arises when I try to use the onMouseOver and onMouseOut handlers inside of a txt file that is brought in by AJAX. If I paste the <img> code inside of my index.php, the js works and the picture flips. If I paste the <img> code inside of my txt file to be inserted into the index.php page via AJAX (when a menu button is clicked), the onMouseOver and onMouseOut give me a javascript error: "Line 25: Object Expected". I think this is referring to line 25 of the .txt file because that is the line right before the <img> code. Does anyone see what I'm doing wrong? Link to comment Share on other sites More sharing options...
jeffman Posted April 10, 2009 Share Posted April 10, 2009 Link to comment Share on other sites More sharing options...
therschbach Posted April 11, 2009 Author Share Posted April 11, 2009 ? Link to comment Share on other sites More sharing options...
Synook Posted April 11, 2009 Share Posted April 11, 2009 Link? Link to comment Share on other sites More sharing options...
therschbach Posted April 13, 2009 Author Share Posted April 13, 2009 Link? Dirtjournal.comWhat the.... it's working now. LoL. I haven't changed anything. Maybe something was stuck in my cache before I fixed it. Nevermind I guess. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.