let formData = new FormData($('#uploadFile')[0]);
iframes.window.postMessage(formData,"*")
//serialize()
传输内容过大:
Uncaught DOMException: Failed to execute 'postMessage' on 'Window': An object could not be cloned.
Uncaught DOMException: Blocked a frame with origin "http://localhost:8088" from accessing a cross-origin frame.
a) 运行机制
SendMessage 函数发送消息,等待消息处理完成后,SendMessage才返回。
PostMessage函数发送消息,不等待消息处理完成,立刻返回。
b) 运行内幕
SendMessage函数将指定的消息发到窗口。它调用特定窗口的窗口消息处理函数(即WndProc函数),并且不会立即返回,直到窗口处理函数处理了这个消息
PostMessage函数将一个消息放入与创建这个窗口的消息队列相关的线程中,并立刻返回不等待线程处理消息。
c) 内部实现
SendMessage 内部调用 SendMessageW、SendMessageWorker 函数做内部处理,然后调用UserCallWinProcCheckWow、InternalCallWinProc 来调用我们代码中的消息处理函数,消息处理函数完成之后,SendMessage 函数便返回了。
PostMessage 将消息放入消息队列中,自己立刻返回,消息循环中的GetMessage处理到我们发的消息之后,便按照普通消息处理方法进行处理。
相关文章:http://www.itguai.com/javascript/a4719336.html
原理:http://dreamylights.blog.51cto.com/1163218/1325841
跨域相关:http://www.cnblogs.com/alsy/p/5470772.html
http://www.ruanyifeng.com/blog/2016/04/cors.html