阿贾克斯什么都不显示

时间:2019-04-08 06:12:45

标签: jquery ajax

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $.ajax({url: "demo_test.txt",  async: true,success: function(result){
      $("#div1").html(result);
    }});
  });
});
</script>
</head>
<body>

<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>

<button>Get External Content</button>



</body>
</html>

这是我想在这里描述的代码。 当我单击按钮时,ajax调用没有发生。 控制台中没有错误。 请帮助

0 个答案:

没有答案
相关问题