我正在使用 ajax 调用将 mycontent.php 加载到我的模式对话框中。我正在使用 AJAX,但是当 mycontent.php 位于模式窗口中时,这 3 个 javascript 标记没有被包含或执行。
我已经尝试过 eval 语句,但似乎不起作用。
这是我的代码:
main.html
<a class="dialog" title="testvideo" href="mycontent.php">
<img class="imageleft" width="200" height="150" src="assets/images/photos/deya/thumbnail.jpg"></a>
modal.js
$(document).ready(function() {
$('a.dialog').click(function (event) {
if ($("body").hasClass("res-full")){
event.preventDefault();
$this = $(this);
var URL = $(this).attr('href');
var dialogbox = document.getElementById('dialog');
var dialogOptions = {
height: 'auto',
width: 'auto',
modal: true,
// open: function(event, ui){
// },
close: function(event, ui){
$('#dialog').empty();
}
};
if(dialogbox==null) {
$this.after("<div id=\"dialog\"></div>");
}
jQuery('#dialog').load(URL + " #content", function() {eval($('script').html())}).dialog(dialogOptions);
}
});
});
我的内容.php
<div id="content">
<div id="VidPlayerPlaceholder_7001_wrapper">
<object id="VidPlayerPlaceholder_7001" width="100%" height="100%" type="application/x-shockwave-flash" data="video/player/player6.swf" bgcolor="#000000" name="VidPlayerPlaceholder_7001" tabindex="0">
<div id="VidPlayerPlaceholder_7001_jwpsrv" style="position: absolute; top: 0px; z-index: 10;"></div>
</div>
<script type="text/javascript" src="http://www.mycompany.com/video/player/js/jwplayerv6.js"></script>
<script type="text/javascript">jwplayer.key="jCz8k6TcT9i6M5vRXEI474+6dfNf9a7gHBbRfA==";</script>
<script type="text/javascript">
jwplayer('VidPlayerPlaceholder_4029').setup({
flashplayer: "http://www.company.com/video/player/player6.swf",
html5player: "http://www.company.com/video/player/js/jwplayer.html5.js",
playlist: [
{ image: "http://pciture.jpg", file: "rtmp://DEYA/video3.m4v"}
],
width: '505',
height: '430',
stretch: 'uniform',
autostart: 'false',
repeat: 'false',
logo: {
file: 'http://ccopyright.png',
link: 'http://www.mycompany.ca',
hide: '',
position: 'top-left'
},
rtmp: {
bufferlength: '5'
},
primary: 'html5'
});
jwplayer('VidPlayerPlaceholder_4029').setVolume(50);
if(0 > 0){
jwplayer('VidPlayerPlaceholder_4029').stop();
jwplayer('VidPlayerPlaceholder_4029').seek(0);
if('false' == 'false'){
jwplayer('VidPlayerPlaceholder_4029').pause();
}
}
</script>
如果有人可以提供帮助,将不胜感激。