HTML5:使用postMessage实现Ajax跨域请求 由于同源策略的限制,Javascript存在跨域通信的问题,典型的跨域问题有iframe与父级的通信等. 常规的几种解决方法: (1) document.domain+iframe: (2) 动态创建script: (3) iframe+location.hash: (4) flash. 这里不细说这几种方法,记录的是HTML5的window.postMessage.postMessage兼容IE8+.Firefox.Opera.Saf…