当我在我的php文件中使用loadXMLDoc()时,带有视频内容的页面不显示视频

时间:2014-03-22 17:59:29

标签: javascript php jquery html video

我想在div格式的同一页面打开一个包含flowplayer-3.2.18的链接页面。我在我的php文件中使用了loadXMLDoc()。当我点击链接页面打开所有内容显示正确但视频不显示 我的脚本是

<script type="text/javascript">
    function loadXMLDoc(id) {
        var xmlhttp;
    var myid=id;
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp=new XMLHttpRequest();
        } else {
            // code for IE6, IE5
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function() {
            if (xmlhttp.readyState==4 && xmlhttp.status==200) {
                document.getElementById("content").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("POST","videopage.php?name="+myid,true);
    xmlhttp.send();
}
</script>

,访问代码是

<a href="javascript: loadXMLDoc('<?php echo $row1[0];?>');" >

并且目标div代码是

<a href="<?php echo $row[3]; ?>"  style="display:block;width:500px;height:400px;"  id="player">
            </a>

        <script language="JavaScript">
             flowplayer("player", "flowplayer-3.2.18.swf");
            </script>

好的我有一个主页面视频包含三个div并包含三个不同的页面

    

</div>


<div id="content">
<?php include "videohome.php";?>
</div>


<div id="aside">
<?php include "add.php";?>
</div>

和视频列表页面显示主题列表和子主题

<ul style=list-style-image:url('arrow.png');list-style-type: none;>
    <?php

    include "config.php";
    $q=mysql_query("select DISTINCT(category) from video");


    while($row=mysql_fetch_row($q))
    {


            ?>

            <h3 ><b>
            <li >

            <?php

             echo   $row[0] ;
            ?>
            </b></li></h3>
            <?php

            $q2=mysql_query("select title from video where category='$row[0]'");


            ?>
            <div>
            <p>
            <ul>
            <?php
            while($row1=mysql_fetch_row($q2))
                {



                ?>

                <li>

                <a href="javascript: loadXMLDoc('<?php echo $row1[0];?>');" >

                <?php

                 echo   $row1[0];
                ?>
                </a>
                </li>
                <br>
                <?php


                }   



        ?>
        </ul>
        </li>
        </p>
        </div>
        <?php
    }



    ?>
</ul>
</div>

当我点击链接然后在div内容videopage.php打开

<script src="flowplayer-3.2.13.min.js"></script>

</head>
<body>



<?php
$name=$_GET['name'];

include "config.php";
$q=mysql_query("select * from video where title='$name'");
    $row=mysql_fetch_row($q);

<div id="videoset">
        <p align="center">
        <a href="<?php echo $row[3]; ?>"  style="display:block;width:500px;height:400px;"  id="player">
            </a>

        <script language="JavaScript">
             flowplayer("player", "flowplayer-3.2.18.swf");
            </script>


</div>

0 个答案:

没有答案