UNPKG

yunlongzha_try_nodejs

Version:

try it

23 lines 505 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script type="text/javascript" src='ajax.js'></script> <script type="text/javascript"> window.onload=function(){ var btn1=document.getElementById('btn1'); btn1.onclick=function(){ ajax('a.txt',function(ok){ alert('好的') },function(){ alert('失败') }) } } </script> </head> <body> <input id='btn1' type='button' value='按钮'></input> </body> </html>