Skip to content

superlin/cross-demos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##跨域通信demos

  1. 图像ping
  2. JSONP
  3. Comet
    • Http Streaming
    • Long Polling
  4. Server-sent Events
  5. Websocket
  6. iframe
    • document.domain
    • URL.hash
    • Cross-fragment
    • Window.name
    • postMessage

##注意:

  • 1-5请求都是发送到localhost:3000,为了实现跨域,打开页面时地址请使用127.0.0.1:3000
  • iframe需要配置hosts
127.0.0.1 www.myapp.com
127.0.0.1 sample.myapp.com
127.0.0.1 www.otherapp.com

About

多种跨域通信示例

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published