5 ms·
AJAX's origins are actually really cool. It started before XmlHttpRequest. If I recall correctly, when the user took an action that required a server response,
by Lt_Riza_Hawkeye 7y ago
AJAX's origins are actually really cool. It started before XmlHttpRequest. If I recall correctly, when the user took an action that required a server response, the javascript would make a 1px by 1px iframe and load it to a specific URL with the important information in the query parameters. The response would look something like this
<html>
<head>
<script>
someGlobalFunction({
searchResults: [
{"name": "Joseph Paul"},
{"name": "Joe McCray"}
]
});
</script>
</head>
</html>
Then once the iframe was loaded, `someGlobalFunction` would handle the results and update the page.
- noodle 7y agoXML Data Islands were also an early version of XHR that MS introduced in the late 90s. It allowed you to load XML sort of like an image, and then hook into the loading events .
- smarterclayton 7y agoA lot of early web apps heavily abused this pattern - I worked on a web framework that used iframes to manage widget state, and of course at that time everyone had to support IE5 and 6. But those browsers by default had this charming noise (an audible click) every time a page loaded or iframe loaded. When you would click a widget button you’d here this curious storm of clicks as the iframes all reloaded. That culminated in a super awesome bug called “The Click of Death” where sometimes on IE6 you’d click an interface element, hear a huge train of clicks, and then ominously, it would fall silent and IE would freeze (hard lockup, no browser interaction possible). Turns out we were deadlocking on CSS and JS loads in those iframes - IE6 only allowed two simultaneous connections, and if you got out of order you couldn’t load an iframe because the connections were waiting to clear the CSS item the JS needed to load.
- reaperducer 7y agoBut those browsers by default had this charming noise (an audible click) every time a page loaded or iframe loaded. When you would click a widget button you’d here this curious storm of clicks as the iframes all reloaded. Wow. I'd forgotten about that. And all these years later, now I know what was going on.