W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/javascript" src="/jquery/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $.ajaxSetup({url:"/example/jquery/demo_ajax_load.txt",success:function(result){ $("div").html(result);}}); $.ajax(); }); }); </script> </head> <body> <div id="txt"><h2>通过 AJAX 改变文本</h2></div> <button>改变内容</button> </body> </html>