【发布时间】:2016-03-21 15:26:59
【问题描述】:
我正在使用这个 polyfill 使服务器端事件 (EventSource) 与 IE 一起使用 - https://github.com/Yaffle/EventSource
效果很好,除了我无法检查来源,就像本教程推荐的那样(出于安全目的)http://www.html5rocks.com/en/tutorials/eventsource/basics/
这是来自 html5rocks 的代码
source.addEventListener('message', function(e) {
if (e.origin != 'http://example.com') {
alert('Origin was not http://example.com');
return;
}
...
}, false);
有没有办法设置和检查原点,让它与 IE 一起工作?
【问题讨论】:
标签: internet-explorer polyfills eventsource