html代码
<!DOCTYPE style PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <HEAD> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>222</title> <link rel="stylesheet" type="text/css" href="css/style.css" /> <link rel="stylesheet" type="text/css" href="css/swiper.min.css" /> <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="js/swiper.min.js"></script> <script type="text/javascript" src="http://192.168.1.107/h5/AppAjax.js"></script> <script type="text/javascript"> $(document).ready(function(){ //ajax_html('#con'); }); </script> </HEAD> <style> </style> <body> <div class="swiper-container" id="page"> <div class="swiper-wrapper swiper-no-swiping"> <!--第一屏--> <div class="swiper-slide "> <div id="con" style="height: 300px; width: 300px; margin: 0 auto; background: #09F"></div> <input name="1111" type="button" value="请求ajax" οnclick="ajax()"/> </div> <!--第二屏--> <div class="swiper-slide "> 222 </div> <!--第三屏--> <div class="swiper-slide "> 3333 </div> <!--End--> </div> </div> <script type="text/javascript"> var page = new Swiper('#page', { //autoplay: 1000 //noSwiping : true, }); </script> </body> </html>
AjaxApp.js 这个js文件要放在服务器上
function ajax(){
alert('666');
}