我有一个ajax脚本,它在我的博客上得到了一篇新的文章和修改。
PHP部分从以下内容开始:
<?php include($_SERVER["DOCUMENT_ROOT"] . "/wp-blog-header.php"); ?>另一部分:
<div id="content" <?php cyberchimps_filter_content_class(); ?>>
<?php do_action( 'cyberchimps_before_content'); ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php elseif ( current_user_can( 'edit_posts' ) ) : ?>
<?php get_template_part( 'no-results', 'index' ); ?>
<?php endif; ?>
<?php do_action( 'cyberchimps_after_content'); ?>
</div> 和ajax:
<script>
(function($) {
$(document).ready(function() {
var refreshId = setInterval(function()
{
$('#content').load('<? echo get_bloginfo('template_directory'); ?>/new.php');
}, 30000);
});
})(jQuery);当ajax中的页面刷新(每30秒发生一次) video.js永远不会恢复时,我只会得到一个糟糕的播放器:
http://i39.tinypic.com/mmycyd.png
我的漂亮球员长得像这样:
http://i41.tinypic.com/xm6894.png
我的网站: neocsatblog.mblx.hu
怎么解决这个问题?
发布于 2013-10-29 13:06:02
页面上的video.js不是video.js标记与之相关的文件。但是,这似乎是您想要使用的,因为您在视频元素上使用了data-setup="{}"。
将video.js脚本和css添加到页面中:
<link href="//vjs.zencdn.net/4.2/video-js.css" rel="stylesheet">
<script src="//vjs.zencdn.net/4.2/video.js"></script>如果在加载页面(例如通过ajax)之后将视频添加到DOM中,也请参阅video.js文档中的“video.js”。基本上,在添加了<video>元素之后,请执行
videojs("your_video_element_id", {}, function(){
// Player (this) is initialized and ready.
});https://stackoverflow.com/questions/19610497
复制相似问题