9 ms·
The use of XMLHttpRequest to fetch JSON has come to dominate to the point that people seem to forget that it had any other use, but it is worth occasionally rem
by jerf 12y ago
The use of XMLHttpRequest to fetch JSON has come to dominate to the point that people seem to forget that it had any other use, but it is worth occasionally reminding people that the original purpose was to fetch HTML, which the browser turned into DOM nodes via its fast parsing path, which could then be added to the page via DOM manipulation.
I fully realize this is not what the linked page is proposing, but it is not clear to me that using that wouldn't be a better idea, leaving the selection of templating to the user. Template languages, while smaller than programming languages, share their characteristic that there isn't obvious One Solution That Solves Everything. You can optimize them for different use cases and it is not clear to me that we can or should privilege one over the others. Given how rapidly the web is heading away from an overprivileged programming language being the only choice, this seems like going the wrong direction.
(Also, if your template language is slowing your server down, fix that. That's a problem with your implementation language, not the fundamental concept.)
- TazeTSchnitzel 12y agoUh, the original purpose of XMLHttpRequest was to fetch XML, as its name implies. AJAX stands for Asynchronous JavaScript And XML
- jerf 12y agoI'm not able to substantiate this with links, but I believe the idea was that the "XML" in question was going to be XHTML most likely, rather than generic "XML", though it did support the generic XML use case. I could be wrong, if the original Outlook web interface this was supported for really did return XML that was not XHTML at some point. It was a crazy time. XHTML was still "inevitable", and people were pretty sloppy with the terms.
- frik 12y agoWrong. It was called "XMLHTTP", created by Microsoft for Outlook Web Access 2000. Mozilla implemented it as XMLHttpRequest JavaScript object in Gecko. The main reason of XHR/AJAX was XML, but Text and HTML are supported too. See Wikipedia for the correct history: http://en.wikipedia.org/wiki/XMLHttpRequest http://en.wikipedia.org/wiki/XMLHttpRequest Microsoft never implemented the XHTML standards in Internet Explorer. IE cannot open files with .xhtml file extension and with .htm(l) extension the page is rendered with HTML quirksmode.
- tmzt 12y agoAny idea what the MSDN tree view used in the 1998 timeframe? I know it loaded the contents on demand when you expand3d a node and I remember it doing so using an automation object with CreateObject.
- frik 12y agoMSDN used HTML4 frames for a long time (afaik until ca. 2006). The left side bar (left frame) with the tree was a Java applet and with the relauch in 2000 a DHTML page. The tree was expanded using DHTML (a marketing term that describes HTML with heavy Javascript usage). Javascript was used to change the visibility of DOM nodes (tree). That data of the TOC tree was loaded as XML (XMLHTTP). Article that explains the MSDN server backend (1999): https://web.archive.org/web/19990505061257/http://msdn.microsoft.com/msdn-online/MSDNchronicles.asp https://web.archive.org/web/19990505061257/http://msdn.micro... Before that relaunch in 2000, the MSDN library used (MS) Java for the left side bar (TOC tree): https://web.archive.org/web/19990423231040/http://msdn.microsoft.com/library/default.htm https://web.archive.org/web/19990423231040/http://msdn.micro... The DHTML version of MSN library (2000): https://web.archive.org/web/20000510200809/http://msdn.microsoft.com/library/default.asp https://web.archive.org/web/20000510200809/http://msdn.micro... , the 2001 version works: https://web.archive.org/web/20011108064645/http://msdn.microsoft.com/library/default.asp https://web.archive.org/web/20011108064645/http://msdn.micro... XML toc tree data: https://web.archive.org/web/*/http://msdn.microsoft.com/library/msdn-online/shared/xmltoc/inc/toc.inc https://web.archive.org/web/*/http://msdn.microsoft.com/libr... (sadly not archived)
- Igglyboo 12y agoXHTML is XML
- TazeTSchnitzel 12y agoTheoretically, yes! In practice it isn't, because people are sloppy.