简体   繁体   English

我的jQuery函数加载了一个HTML,但该HTML没有从不同的函数(来自flowplayer)加载不同的jQuery选择器

[英]My jQuery function is loads an HTML, but that HTML does not load a different jQuery selector from a different function (from flowplayer)

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);
});

id="player" in the html that is an output is suppose to call the flowplayer function, which is not working. 作为输出的html中的id =“player”被认为是调用flowplayer函数,该函数不起作用。 What am I doing wrong? 我究竟做错了什么? anyhelp thanks. 谢谢。谢谢。

The following line... 以下行......

flowplayer("player", {src: "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf", cachebusting: true, wmode: "transparent"});

...must appear right AFTER this line: ......必须在此行之后出现:

$('#slidedata').html(rackOutput);

Why? 为什么? Because it is when the id="player" element exists in the document. 因为当文件中存在id="player"元素时。

Could you provide a link to this page or setup a JS Fiddle . 你能提供这个页面的链接或设置JS小提琴吗? It's hard to know exactly what's going wrong without seeing the full html that your javascript is running in. I don't see anything obviously wrong, but I can't help without seeing the complete page. 如果没有看到你的javascript运行的完整html,很难确切知道出了什么问题。我没有看到任何明显的错误,但是如果没有看到完整的页面我就无法帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM