<html>
<head>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$.ajax({
url: "text/a.txt",
type: "GET",
dataType: "jsonp",
crossDomain: true,
beforeSend: LoadFunction, //加载执行方法
error: erryFunction, //错误执行方法
success: succFunction, //成功执行方法
//jsonpCallback: function(data) {alert(1);console.log(data);}
})
function LoadFunction() {
}
function succFunction(data) {
alert(data);
}
function erryFunction(e) {
alert(2);
}
});
</script>
</head>
<body>
</body>
</html>
<head>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$.ajax({
url: "text/a.txt",
type: "GET",
dataType: "jsonp",
crossDomain: true,
beforeSend: LoadFunction, //加载执行方法
error: erryFunction, //错误执行方法
success: succFunction, //成功执行方法
//jsonpCallback: function(data) {alert(1);console.log(data);}
})
function LoadFunction() {
}
function succFunction(data) {
alert(data);
}
function erryFunction(e) {
alert(2);
}
});
</script>
</head>
<body>
</body>
</html>