跨域:只要协议、域名、端口有任何一个不同,都被当作是不同的域。
解决:
jsonp方式的详解 http://blog.csdn.net/notechsolution/article/details/50394391
js的中方法 http://www.cnblogs.com/2050/p/3191744.html
后端通过给HttpServletResponse response设置header来允许跨域
response.setHeader('Access-Control-Allow-Origin',协议域名端口)
response.setHeader(Access-Control-Allow-Credentials true);