加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

模仿优酷视频无刷新留言

发布时间:2020-12-15 06:21:18 所属栏目:百科 来源:网络整理
导读:? !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns="http://www.w3.org/1999/xhtml" head meta http-equiv="Content-Type" content="text/html; charset=utf-8" / ti
?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
#comment{
?
?width:500px;
?height:300px;
?background:#FC9;
?}
</style>
<script src="../Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>

<body>
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="960" height="400">
? <param name="movie" value="1.swf" />
? <param name="quality" value="high" />
? <param name="wmode" value="opaque" />
? <param name="swfversion" value="9.0.45.0" />
? <!-- 此 param 标签提示使用 Flash Player 6.0 r65 和更高版本的用户下载最新版本的 Flash Player。如果您不想让用户看到该提示,请将其删除。 -->
? <param name="expressinstall" value="../Scripts/expressInstall.swf" />
? <!-- 下一个对象标签用于非 IE 浏览器。所以使用 IECC 将其从 IE 隐藏。 -->
? <!--[if !IE]>-->
? <object type="application/x-shockwave-flash" data="1.swf" width="700" height="300">
??? <!--<![endif]-->
??? <param name="quality" value="high" />
??? <param name="wmode" value="opaque" />
??? <param name="swfversion" value="9.0.45.0" />
??? <param name="expressinstall" value="../Scripts/expressInstall.swf" />
??? <!-- 浏览器将以下替代内容显示给使用 Flash Player 6.0 和更低版本的用户。 -->
??? <div>
????? <h4>此页面上的内容需要较新版本的 Adobe Flash Player。</h4>
????? <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="获取 Adobe Flash Player" width="112" height="33" /></a></p>
??? </div>
??? <!--[if !IE]>-->
? </object>
? <!--<![endif]-->
</object>
<hr>
<textarea cols="40" rows="4" id="comm"></textarea>
<input type="button" value="发表评论" onclick="getComment()">
<div id="comment"></div>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
<script language="javascript" type="text/javascript">
function getComment(){
?//创建XMLHttpRequest对象
?var xhr=new XMLHttpRequest();
?//获取用户输入的内容
?var comment=document.getElementById("comm").value;
?//获取div对象
?var div=document.getElementById("comment");
?var url="AJAX-pinglun.php?comment="+encodeURI(comment)+"&r="+Math.random();
?xhr.open("get",url,true);
?xhr.send(null);
?xhr.onreadystatechange=function (){
??if(xhr.readyState==4){
???var p=document.createElement("p");
???var text=document.createTextNode("评论内容:"+xhr.responseText);
???p.appendChild(text);
???div.appendChild(p);
???
???}
??
??
??}
?
?
?}
</script>
</body>
</html>

?

<?php

echo $_GET["comment"];

?>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读