doulian8554 2012-06-14 13:17
浏览 35
已采纳

查询串如何工作

This isn't the best question ever, but since search engines feel the need to ignore symbols, I have to ask somewhere.

In a link, I'll sometimes see a ?, such as [link]/file.extension?some_type_of_info, or even +,&,=, etc ('best example' of what I mean is youtube videos). What are these called and what do they do? A good site would be great to :)

I am mostly interested because I have a site that loads stuff into a page, and currently the way I allow 'bookmarking' a page (or more important to me, being able to go back a 'page') is use hash values to represent my 'page'.

Ultimately I would like to not have the page refresh, which is why hash values are good, but I'd like alternatives if any (not really what hashmarks are meant for, but mostly different browsers seem to treat assigning the hash values in jquery differently)

Again, sorry this is mostly just a "what is this" question, but if anyone could tell me pros/cons towards using the method in question versus hash values, that would be great also :)

  • 写回答

5条回答 默认 最新

  • dongtao5055 2012-06-14 13:22
    关注

    See the url specification, in particular the section syntax components:

      URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
    

    … and the definition of query.

    The query component contains non-hierarchical data that, along with
    data in the path component (Section 3.3), serves to identify a
    resource within the scope of the URI's scheme and naming authority
    (if any). The query component is indicated by the first question
    mark ("?") character and terminated by a number sign ("#") character
    or by the end of the URI.


    Ultimately I would like to not have the page refresh

    Use the history API. This is independent of the structure of the URL (other than having to be a URL on the same origin).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制