Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

iframe is loading a whole page with script permissions (and sandboxed). it seems there isnt any tag for adding a remote snippet of html, like you can do with ajax


What do you mean by "remote snippet of html"? An iframe loads whatever's on the other end of the src URL. If that's a "whole page", then it loads a whole page. If it's just a "snippet" of content, then it loads that. Any snippet you think of can be loaded by iframe exactly as described. The only hitch, really, is that it's always treated as block-level content instead of CSS-style "inline" flow-level content, but that's clearly not relevant to the use case at hand—embedded tweets are already block-level.

It's not clear what you're asking for. (E.g. do you want that snippet not to be sandboxed?)


iframe is a full page. i mean some HTML code, a div or some text or a table etc. the kind of things we load with Ajax. The equivalent of <img>, but for HTML content : <remotehtml src="https://twitter.com/snip/12345678" />


This isn't really any clearer than your earlier comment.

> iframe is a full page.

An iframe loads whatever you give it. If you give it a URL to a "full page"/"whole page", then it loads that. If the URL leads to e.g. "a div" or "a table", then that will be loaded. That's under the control of the person who's putting stuff on the other end of the URL. To repeat, there is exactly one case where this doesn't hold up: when you want the loaded content to be inline and not block-level (e.g. "some text"—and if inline content is what you meant, then you should say that instead of just giving another vague response; again, though, even if that is what you want, how would that be relevant to the use case we're talking about here: embedding tweets?)


it doesnt inherit style etc. it s also a completely different document for scripting purposes. it s also rather heavy, hard to have 100 iframes in a page


Side note: this would have been a lot easier if in response to, "do you want that snippet not to be sandboxed?" you'd just said, "yes".

What you're proposing stands little chance of being implemented, given the security implications.


it s just an idea not a proposal. it would be sandboxed, the idea is to allow html only, so as to avoid scripting. don't we do that all the time with ajax?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: