Newbie_小白
没有都对的别人,也没有全错的自己,至少要有自己的坚持,无关他人、无关外物!
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
    <div id="box">
        <input type="button" value="按钮" onclick="get()">
    </div>
    <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="http://localhost/workSpace/data/sug.php"></script>
    <script>
        function get(){
            $.ajax({
                  type : "GET",
                  url : "data/sug.php",
                  success : function(json) {
                       console.log(json);
                  }
            });
        }
    </script>
</body>
</html>

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
    <div id="box">
        <input type="button" value="按钮" onclick="get()">
    </div>
    <script type="text/javascript" src="js/jquery.min.js"></script>
        <!-- <script type="text/javascript" src="http://localhost/workSpace/data/sug.php"></script> -->
    <script>
        function get(){
            $.ajax({
                  type : "GET",
                  url : "http://localhost/workSpace/data/sug.php",
                  success : function(json) {
                       console.log(json);
                  }
            });
        }
    </script>
</body>
</html>

 

posted on 2017-07-26 16:31  Newbie_小白  阅读(151)  评论(0编辑  收藏  举报