Why does Twitter use a hash and exclamation mark in URLs, and how do they rewrite search URLs?

前端 未结 3 1176
长发绾君心
长发绾君心 2020-12-05 13:13

We understand the hash is for AJAX searches, but the exclamation mark? Anyone know?

Also, the \"action\" attribute for their search form points to \"/search,\" but

3条回答
  •  生来不讨喜
    2020-12-05 13:32

    To answer the second part then: It is redirecting you to /#!/search.

    If you look at the response headers when going to http://twitter.com/britishdev (plug plug) you are returned a 302 (temporary redirect) with the Location header set as "Location: http://twitter.com/#!/britishdev"

    Yes JavaScript is then pulling all your detail in on the destination page but regardless that is where you are redirected to.

提交回复
热议问题