|
js代码
function ajax(){
//alert('222');false;
$.ajax({
url:'http://192.168.1.107/h5/d.html',
success: function(html){
alert(html);
},
error:function (){
alert('error');
}
})
}
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>
<script type="text/javascript" src="js/swiper.min.js"></script>
<script type="text/javascript" src="http://192.168.1.107/h5/AppAjax.js"></script>
</HEAD>
<style>
</style>
<body>
<div id="con" style="height: 300px; width: 300px; margin: 0 auto; background: #09F"></div>
<input name="1111" type="button" value="请求ajax" onclick="ajax()"/>
</body>
</html>
问题
在webapp情况是可以用$.ajax调取数据,但在wex5环境下,$.ajax只可以调用 alert('内容') 却调取不到到
$.ajax({
url:'index.html'
})
中的html页面内容, 求指教,求解决办法
|
|