Meebo Bar 等工具栏如何工作?
Meebo 的新“栏”服务只需少量 Javascript 和 HTML,即可在任何给定网页的底部放置一个带有链接和聊天功能的浮动栏。我想构建类似的东西,但我对他们如何解决相同的起源问题感到困惑。
看起来他们正在注入一个 iframe 和一些 script
标签,但他们如何在没有代理的情况下完成其余功能超出了我的范围。有什么想法吗?
你可以在那里查看 Meebo 的服务 http://bar.meebo.com/ ,Robert Scoble 似乎有它在 http://scobleizer.com 上设置。
注意:我无意成为 Meebo 或 Scoble 的托儿,我只是对实现感到好奇。
Meebo's new 'bar' service puts a floating bar with links and chat functions at the bottom of any given webpage with just a dash of Javascript and HTML. I'd like to build something like it, but I'm flummoxed as to how they got around the same origin issues.
It looks like they're injecting an iframe and some script
tags, but how they accomplish the rest of the functionality without a proxy is beyond me. Any ideas?
You can check out Meebo's service http://bar.meebo.com/ there and Robert Scoble seems to have it setup over on http://scobleizer.com.
NB: I don't mean to be a shill for either Meebo or Scoble, I'm just curious about the implementation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
HTTP GET 可以跨域,因此神奇之处在于您使用什么方法。还有其他方法可以将数据发送到与服务页面的主机不同的主机,例如 window.name 技巧,其中可以将信息(通常一次少于 2k)设置为 window.name 属性(这里是一个 < a href="http://www.sitepen.com/blog/2008/07/22/windowname-transport/" rel="nofollow noreferrer">链接)
您还可以使用一个小型 Flash 播放器(< a href="http://flxhr.flensed.com/" rel="nofollow noreferrer">flXHR 效果很好)
智能 JavaScript 实际上可以利用任何可用的。也不要为 Meebo 的先令感到难过,那些家伙摇滚!
HTTP GETs can be across domains, so part of the magic is in what method you utilize. There are also other methods for sending data to a different host than the one serving the page, like the window.name trick where information (usually less than 2k at a time) can be set to the window.name property (here is a link)
You can also utilize a little Flash player (flXHR works great)
Smart JavaScript can actually utilize which ever one is available. Also don't feel bad for shilling for Meebo those guys rock!