URL,哈希或查询字符串中应优先显示的是什么? [英] What should come first in URL, hash or querystring?

查看:88
本文介绍了URL,哈希或查询字符串中应优先显示的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些在线文章说,URL中的 querystring hash 尚无标准,但我们一直在继续跟踪.因此,我的问题是在同一URL中同时具有querystring和hash的更好方法是什么.

Some online articles says, that there is no standard for querystring and hash in URL, but we are following what has continued to happen. So, my question is what should be a better way of having both querystring and hash in same URL.

我认为的问题是,如果哈希跟随查询字符串,它可以成为某些查询字符串数据的值,如果查询字符串跟随哈希,则整个查询字符串可能会变得很麻烦.那么,我应该遵循什么顺序?

The problem I think is, if hash follows querystring, it can become a value to some querystring data and if querystring follows hash, the whole querystring may become a hask. So, what order should I follow?

推荐答案

一些在线文章说,URL中的查询字符串和哈希没有标准

Some online articles says, that there is no standard for querystring and hash in URL

它们是错误的,或者您是在误解它们.

Either they are wrong or you are misinterpreting them.

查询字符串必须出现在片段标识符(您称为哈希)之前.

The query string must appear before the fragment identifier (which you call the hash).

规范显示URI的格式:

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

它清楚地显示了查询之后出现的片段.

It clearly shows the fragment appearing after the query.

如果哈希值紧跟查询字符串,则它可以成为某些查询字符串数据的值

if hash follows querystring, it can become a value to some querystring data

不能.#是一个特殊字符,指示片段的开始.要在查询字符串数据中包含一个,必须将其转义为%23 .

It can't. The # is a special character that indicates the start of the fragment. To include one in query string data it needs to be escaped as %23.

这篇关于URL,哈希或查询字符串中应优先显示的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆