TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Janky.post: Making cross-domain possible in javascript one request at a time

14 点作者 pyronicide超过 14 年前

5 条评论

jtchang超过 14 年前
At one point one has to step back and ask what the hell we've created.<p>I mean really: creating hidden iframes with onload actions that post to another domain. I don't know whether to be proud of our ingenuity or sad that this is the cutting edge of interprocess communication for the web.
samstokes超过 14 年前
This is pretty cool. (tl;dr summary: creates a hidden iframe with a form pointing to the remote domain, submits the form, and uses postMessage to send the result back to the parent frame.)<p>We experimented with something similar a while ago, but found that creating and destroying all those iframes could slow down older browsers. (Our use case potentially required sending requests relatively frequently.) Have you observed anything like that with this technique?
评论 #2124776 未加载
dedward超过 14 年前
Security is a big one here - doing a &#60;Script src=&#62; include from another domain might be really convenient for getting around cross-domain limits - but if that remote server has been compromised, or if it's run by dodgy individuals, they now have complete control of your webpage and can do incalculable damage to your business.
makmanalp超过 14 年前
Hold up, aren't cross-domain requests disallowed for a good reason (security)? I get that Access-Control is unsupported in old IE, but gosh, doesn't it make way more sense?
评论 #2125401 未加载
rsoto超过 14 年前
Pretty interesting, but it seems like it doesn't work with FF4 b8.<p>Since it uses an iframe, it'll be interesting to know what happens on a site that detects that.
评论 #2124723 未加载