Why doesn't Twitter and Google API documentation encode ampersands in URLs?

前端 未结 2 2112
后悔当初
后悔当初 2021-02-19 09:14

I have read I should encode my ampersands as & in HTML.
However numerous code samples from respected companies somehow forget

2条回答
  •  心在旅途
    2021-02-19 09:46

    Is there any real benefit from not escaping ampersand in links?

    It saves a few keystrokes.

    Is this related to browser quirks?

    No

    Is this just a mistake in documentation?

    Yes

    Is there a reason API documentation by respectable companies often violates this rule?

    Ignorance and/or laziness. Browsers perform error recovery so they either don't notice the errors or they don't care. The documentation probably isn't written by their best experts.

提交回复
热议问题