[jQuery] Re: Injecting an tag

Sun, 16 Sep 2007 19:05:01 -0700

Althougth I can't repeat it,  I believe I got lost with trying to
figure out why it wouldn't work with a style of  display:none for the
<div id="divAudio"></div> container, having multiple instances of the
java class loaded and replaying the sound.  Appending allow me to
create a new instance and was able to play it again.

But I got it wokring now with the single instance, replaying on
clicks,  but now I'm just trying to figure out why I can't use
"display:none."  :)   I guess I have to hide off in some minus
coordinates!

--
HLS

On Sep 16, 3:23 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> Yeah, you had me wondering for a minute. I got curious and looked up the code.
>
> This is the code for .html():
>
>     html: function( val ) {
>         return val == undefined ?
>             ( this.length ? this[0].innerHTML : null ) :
>             this.empty().append( val );
>     },
>
> In the case we are talking about, that is equivalent to:
>
>     html: function( val ) {
>         return this.empty().append( val );
>     },
>
> So you would kind of expect .html() to behave similarly to .append(), and 
> probably identically in the case where the container
> element is already empty.
>
> -Mike
>
> > From: Pops
>
> > hmmmmmm,  seems to work now.  Never mind.
> > On Sep 16, 2:57 pm, Pops <[EMAIL PROTECTED]> wrote:
> > > Why do I need to .append() to a container rather than use
> > > .html() for <applet> tags?
>
> > > function PlayAudioWav(src)
> > > {
> > >    var s = "";
> > >    if (jQuery.browser.msie) {
> > >       s += '<bgsound src="'+src+'">';
> > >    } else {
> > >       s += '<applet code="wcAudioPlay.class" width=0 height=0
> > > codebase="/public">';
> > >       s += '<param name="src" value="'+src+'">';
> > >       s += '</applet>';
> > >    }
> > >    //$("#divAudio").html(s);   // html() does not work, use append()
> > >    $("#divAudio").append(s);
> > >    return;
>
> > > }
>
> > > The behavior applies to FF only. For IE, I can inject
> > > <bgsound> fine.

Reply via email to