Why is it called XMLHttpRequest?

后端 未结 3 2016
囚心锁ツ
囚心锁ツ 2020-12-15 14:46

I always wonder why this object is called like that?

The body of your request does not need to be in XML format. Also, data received from server can be fetched as JS

3条回答
  •  余生分开走
    2020-12-15 15:39

    Short

    Yes, the XML part in the name is all wrong.

    Long

    The best explanation comes from the MS engineer who invented XHR:

    This was the good-old-days when critical features were crammed in just days before a release…I realized that the MSXML library shipped with IE and I had some good contacts over in the XML team who would probably help out—I got in touch with Jean Paoli who was running that team at the time and we pretty quickly struck a deal to ship the thing as part of the MSXML library. Which is the real explanation of where the name XMLHTTP comes from—the thing is mostly about HTTP and doesn’t have any specific tie to XML other than that was the easiest excuse for shipping it so I needed to cram XML into the name.

    -- Alex Hopmann The story of XMLHTTP

    This clearly states that seeking affiliations with XML, no matter how reasonable they are, is basically overinterpretation of authors' intentions.
    Sorry to spoil the fun.

提交回复
热议问题