4 ms·
See my other response on iframes: https://news.ycombinator.com/item?id=6649195 https://news.ycombinator.com/item?id=6649195 One of my big surprises moving to
by nostrademons 13y ago
See my other response on iframes:
https://news.ycombinator.com/item?id=6649195 https://news.ycombinator.com/item?id=6649195
One of my big surprises moving to Google was how much iframes are still used, but even beyond that is the very pragmatic approach of looking for exactly what a technology gives you and what it costs you in return. There's basically a 1:1 correspondence between the API of an iframe and the API of an XHR:
xhr.open = iframe.src
xhr.onreadystatechange = iframe.onload
xhr.response = iframe.contentDocument
Many devs don't like working with iframes because it doesn't fit their mental model of how a request should work (possibly because iframes were initially introduced with a visual extent), but that's a problem with their mental models, not with iframes. You can always wrap the API if you don't like it, anyway - pretty much all the major frameworks do, since raw XHRs are a bit clumsy to use.