嘿,所有,我正在寻找一个新的眼睛检查此代码,看看你是否可以告诉我为什么它不能正常工作......我实际上已经使用了相同的代码之前与1.3.2,这是好的,但由于某种原因与1.4.1我有麻烦...我错过了什么?jQuery replaceWith抛回错误
$(".item").click(function() {
var yt_vid = $(this).children('img').attr("id");
$("#youtube").fadeOut(300, function() {
$("#youtube").replaceWith('<object id="youtube" type="application/x-shockwave-flash" style="width:488px; height:300px; display:none;" data="http://www.youtube.com/v/' + yt_vid + '&hl=en_US&fs=1&hd=1"><param name="movie" value="http://www.youtube.com/v/' + yt_vid + '&hl=en_US&fs=1&hd=1" /><param wmode="transparent"><\/param><\/object>');
$('#youtube').fadeIn(1000);
});
});
的#youtube是在文档加载添加以下代码:
var initialVid = $(".item").children('img').attr("id");
$("#youtubePlayer").append('<object id="youtube" type="application/x-shockwave-flash" style="width:488px; height:300px;" data="http://www.youtube.com/v/' + initialVid + '&hl=en_US&fs=1&hd=1"><param name="movie" value="http://www.youtube.com/v/' + initialVid + '&hl=en_US&fs=1&hd=1" /><param wmode="transparent"><\/param><\/object>');
每当我点击.item,我得到错误的萤火,下列表中我看到“d没有定义”第36行错误(#youtube.fadeOut行)
谢谢!
'<\/param><\/object>'?你是不是指''? – Harmen 2010-02-13 19:51:52