我的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)

本文关键字:HTML jQuery 函数 加载 flowplayer 选择 一个 我的 但该      更新时间:2023-09-26

我的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" 在作为输出的 HTML 中假设调用 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,很难确切地知道出了什么问题。我没有看到任何明显的错误,但是如果没有看到完整的页面,我就无能为力。