[英]Load several js function from the same jquery file unto several html pages at different intervals of my choice
[英]My jQuery function is loads an HTML, but that HTML does not load a different jQuery selector from a different function (from flowplayer)
我的jQuery函数加载了一个HTML,但该HTML没有从不同的函数(来自flowplayer)加载不同的jQuery选择器
flowplayer("player", {src: "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", cachebusting: true, wmode: "transparent"});
$('#options li a').click( function (evt){
evt.preventDefault();
$('#options li').removeClass('current');
$(this).parent('li').addClass('current');
var rackVideo = $(this).attr('href'); //JQUERY PULLS INFO FROM LINK
var rackOutput =
'<a href="http://c3426439.r39.cf0.rackcdn.com/pritchett/'+ rackVideo +'" id="player" style="display:block;width:348x;height:216px; display:block;">'+
'<img src="http://www.p2ortho.com/wp-content/uploads/2010/10/intro-thumb.jpg" alt="Introduction Video" title="Introduction Video" width="348" height="216" class="alignnone size-full wp-image-620" />'+
'</a>';
$('#slidedata').html(rackOutput);
});
作为输出的html中的id =“player”被认为是调用flowplayer函数,该函数不起作用。 我究竟做错了什么? 谢谢。谢谢。
以下行......
flowplayer("player", {src: "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", cachebusting: true, wmode: "transparent"});
......必须在此行之后出现:
$('#slidedata').html(rackOutput);
为什么? 因为当文件中存在id="player"
元素时。
你能提供这个页面的链接或设置JS小提琴吗? 如果没有看到你的javascript运行的完整html,很难确切知道出了什么问题。我没有看到任何明显的错误,但是如果没有看到完整的页面我就无法帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.