<!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>
Me discréditer résister, peut supporter beaucoup de compliments!