Home > Article > Web Front-end > ajax-load example
ajax-load instance
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>1.ajax-load()</title> </head> <body> <img src="../images/zly.jpg" width="150"> <div></div> <button>点击</button> </body> </html> <script type="text/javascript" src="../js/jquery-3.3.1.js"></script> <script type="text/javascript"> $('button').eq(0).on('click',function(){ $('div').eq(0) // .load('api/info.php') // .load('api/info.php'+' p') //支持选择器 // .load('api/info.php'+' h3') // .load('api/info.php',{birthday:'10月16日',nation:"中国"}) //POST // .load('api/info.php','age=31&sex=女') //GET .load('api/info.php','age=31&sex=女',function(){ $('img').css('border-radius','50%') }) //callBack() }) </script>
The above is the detailed content of ajax-load example. For more information, please follow other related articles on the PHP Chinese website!