ajax 效果出不来??
<!DOCTYPE html>
<html>
<head lang="zh">
<meta charset="UTF-8">
<title>使用ajax()方法加载服务器数据</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js
" type="text/javascript"></script>
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<style type="text/css">
#divtest
{
width: 282px;
}
#divtest .title
{
padding: 8px;
background-color:Blue;
color:#fff;
height: 23px;
line-height: 23px;
font-size: 15px;
font-weight: bold;
}
ul
{
float: left;
width: 280px;
padding: 5px 0px;
margin: 0px;
font-size: 14px;
list-style-type: none;
}
ul li
{
float: left;
width: 280px;
height: 23px;
line-height: 23px;
padding: 3px 8px;
}
.fl
{
float: left;
}
.fr
{
float: right;
}</style>
</head>
<body>
<div id="divtest">
<div class="title">
<span class="fl">检测数字的奇偶性</span>
<span class="fr">
<input id="btnCheck" type="button" value="检测" />
</span>
</div>
<ul>
<li>请求输入一个数字
<input id="txtNumber" type="text" size="12" />
</li>
</ul>
</div>
<script type="text/javascript">
$(function () {
$("#btnCheck").bind("click", function () {
$.ajax({
url:'http://www.imooc.com/data/check.php',
data:{ num: $("#txtNumber").val()},
dataType:"json",
type:'post',
success: function (data) {
$("ul").append("<li>你输入的<b>" + $("#txtNumber").val() + " </b>是<b> " + data + "</b></li>");
}
});
});
})
</script>
</body>
</html>