jquery ajax用法升级至较新版
This commit is contained in:
@@ -11,14 +11,14 @@
|
||||
|
||||
//使用JQuery ajax jsonp方式跨域名访问内容
|
||||
function fetchMashupContent() {
|
||||
$.ajax({
|
||||
$.ajax({
|
||||
url:remoteUrl + "/web/mashup",
|
||||
dataType:"jsonp",
|
||||
success:function(data) {
|
||||
dataType:"jsonp"})
|
||||
.done(function(data) {
|
||||
$('#mashupContent').html(data.content);
|
||||
$('#mashupContent').show();
|
||||
}});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<h3>技术说明:</h3>
|
||||
<p>
|
||||
演示基于JQuery的JSONP实现,绕过浏览器对Ajax不能访问跨域名网站内容的限制实现Mashup.<br /> 请先将本页另存为本地html文件,打开本地文件访问本地应用服务器中的内容即为跨域访问的场景.
|
||||
演示基于JQuery的JSONP实现,绕过浏览器对Ajax不能访问跨域名网站内容的限制实现Mashup。<br /> 请先将本页另存为本地html文件,打开本地文件访问本地应用服务器中的内容即为跨域访问的场景。
|
||||
</p>
|
||||
<p>
|
||||
<input type="button" class="btn" value="获取内容" onclick="fetchMashupContent();" />
|
||||
|
||||
Reference in New Issue
Block a user