开发者

jplayer and odd jquery behavior

I'm trying to modify all jplayer titles using the wordpress plugin version.

when adding things the title is stored in a span called .T_mp3j

<span class="T_mp3j" id="T_mp3j_0">1. Blow-Out-Original-Mix3.mp3</span>

when trying to update this in the .ready handler it only appends the value, not replace it.

say

 $('.T_mp3j').html("PLAY SNIPPET");

(or $('.T_mp3j').text("PLAY SNIPPET") );

results in

<span class="T_mp3j" id="T_mp3j_0">
"PLAY SNIPPET"
"1. Blow-Out-Original-Mix3.mp3"
</span>

however, running the same 开发者_如何学运维from the consoles (in chrome or firefox) makes the text replace and not append.

<span class="T_mp3j" id="T_mp3j_0">PLAY SNIPPET</span>

also $('.T_mp3j').empty(); does nothing in .ready but empties in the console.

any suggestions?


It might be that the wordpress plugin add the information with jQuery itself, and your function is run before they add the text, or?

The code works fine if i test it, so there is something interfering with it in your site.

Your working script: http://jsfiddle.net/DdGNT/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜