Forums: Front End:

 

onmouseover, ie7, "object expected"

first
 

baron ruhstoff onmouseover, ie7, "object expected"

This:

<a href="index.html" title="play a note" onmouseover="onStringRollOver('sounds/a3.wav')">a</a>


calls this:

			function onStringRollOver(surl) {

// play the specified sound by embedding it in the page when requested
document.getElementById("soundspan").innerHTML= "<embed src='"+surl+"' hidden=true autostart=true loop=false>";

}


which embeds the sound in this:
<span id="soundspan"></span>


IE7 is throwing an "object expected" error for the a element. What gives?


...........................
site chiggety check!
quote
 

Tha.Riddla

<embed src='"+surl+"'


looks like something might be up with this syntax? maybe try
<embed src="'+surl+'"


or even

<embed src="+surl+"

 

baron ruhstoff

Tried switching the quotes, removing them, and even keeping surl static... same result. The same goes for removing the line entirely.

:sad me:


...........................
site chiggety check!
quote
 

Stickman

Are you defining the function after the href? Might be that IE is looking for the function before it's been defined. shrug.gif

StickBlog - random developer stuff
quote
 

baron ruhstoff

Our educated and erudite colleague ShEx caught the problem: I was defining the script as "application/javascript" rather than "text/javascript."

Well played, ShEx. Well played.


...........................
site chiggety check!
quote
 

ShEx

I would like to thank my friends and family for their support
throughout the trial and error of this problem. It was tough in the
beginning but I was certain I would see the light at the end of the
tunnel. And now, the baron's mouseovers produce sound and
all is well again.

*takes bow*

*falls off stage*

 

arigato

Dammit, if you keep falling in my tuba the bell will never get hammered back into shape properly.

 
first
 

Forums: Front End: onmouseover, ie7, "object expected"

 
New Post
 
You must be logged in to post