From 40cc28caa539abaff067ba8189173e4defaf2ff3 Mon Sep 17 00:00:00 2001 From: Calvin Date: Thu, 17 Oct 2013 02:00:02 +0800 Subject: [PATCH] =?UTF-8?q?jquery=20ajax=E7=94=A8=E6=B3=95=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E8=87=B3=E8=BE=83=E6=96=B0=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/webapp/WEB-INF/views/web/mashup-client.jsp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/showcase/src/main/webapp/WEB-INF/views/web/mashup-client.jsp b/examples/showcase/src/main/webapp/WEB-INF/views/web/mashup-client.jsp index 50648da5..1d6dbe29 100644 --- a/examples/showcase/src/main/webapp/WEB-INF/views/web/mashup-client.jsp +++ b/examples/showcase/src/main/webapp/WEB-INF/views/web/mashup-client.jsp @@ -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(); - }}); - } + }); + } @@ -27,7 +27,7 @@

技术说明:

- 演示基于JQuery的JSONP实现,绕过浏览器对Ajax不能访问跨域名网站内容的限制实现Mashup.
请先将本页另存为本地html文件,打开本地文件访问本地应用服务器中的内容即为跨域访问的场景. + 演示基于JQuery的JSONP实现,绕过浏览器对Ajax不能访问跨域名网站内容的限制实现Mashup。
请先将本页另存为本地html文件,打开本地文件访问本地应用服务器中的内容即为跨域访问的场景。