是否有一种无插件的方式通过jQuery(或没有)检索查询字符串值?
如果是这样,怎么样?如果没有,是否有插件可以这样做?
我需要从给定的URL中提取完整的协议,域和端口.例如:
https://localhost:8181/ContactUs-1.0/contact?lang=it&report_type=consumer
>>>
https://localhost:8181
Run Code Online (Sandbox Code Playgroud) 例:
www.site.com/index.php#hello
Run Code Online (Sandbox Code Playgroud)
使用jQuery,我想将值hello放在变量中:
var type = …
Run Code Online (Sandbox Code Playgroud) javascript ×3
url ×3
dns ×1
jquery ×1
plugins ×1
port ×1
protocols ×1
query-string ×1
url-fragment ×1