為什么不能輸出,沒找到原因
<!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>
? ? ? ? <title>使用ajax()方法加載服務(wù)器數(shù)據(jù)</title>
? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? </head>
? ??
? ? <body>
? ? ? ? <div id="divtest">
? ? ? ? ? ? <div class="title">
? ? ? ? ? ? ? ? <span class="fl">檢測數(shù)字的奇偶性</span>?
? ? ? ? ? ? ? ? <span class="fr">
? ? ? ? ? ? ? ? ? ? <input id="btnCheck" type="button" value="檢測" />
? ? ? ? ? ? ? ? </span>
? ? ? ? ? ? </div>
? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ?<li>請求輸入一個數(shù)字?
? ? ? ? ? ? ? ? ? ?<input id="txtNumber" type="text" size="12" />
? ? ? ? ? ? ? ?</li>
? ? ? ? ? ? </ul>
? ? ? ? </div>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $(function () {
? ? ? ? ? ? ? ? $("#btnCheck").bind("click", function () {
? ? ? ? ? ? ? ? ? ? $.ajax({
? ? ? ? ? ? ? ? ? ? ? ? "http://idcbgp.cn/data/check.php",
? ? ? ? ? ? ? ? ? ? ? ? data: { num: $("#txtNumber").val() },
? ? ? ? ? ? ? ? ? ? ? ? type:"post",
? ? ? ? ? ? ? ? ? ? ? ? success: function (data) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>你輸入的<b>? "
? ? ? ? ? ? ? ? ? ? ? ? ? ? + $("#txtNumber").val() + " </b>是<b> "
? ? ? ? ? ? ? ? ? ? ? ? ? ? + data + " </b></li>");
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? });
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
? ? </body>
</html>
2018-07-20
將網(wǎng)址:http://idcbgp.cn/code/13474 換成?http://idcbgp.cn/code/13474 訪問
2018-06-20
url:"http://idcbgp.cn/data/check.php"
前面jquery引用改成“https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js”
2017-10-18
url:"http://idcbgp.cn/data/check.php"
2017-10-15
"http://idcbgp.cn/data/check.php",前面是不是要有url: