开发者

On load, check what #hash tag there is in the url, and then

开发者 https://www.devze.com 2023-04-11 08:03 出处:网络
I\'d like to load a url with a ha开发者_C百科shtag and grab it to be used in javascript. Ie, say you load www.url.com/#1, I would like to be able to do something like the following in JS:

I'd like to load a url with a ha开发者_C百科shtag and grab it to be used in javascript.

Ie, say you load www.url.com/#1, I would like to be able to do something like the following in JS:

var hash_value = get_the_hash_value();

do_something_with(hash_value);

How does one perform something like this?


window.location.hash

Oops! Your answer couldn't be submitted because: body must be at least 30 characters; you entered 22

0

精彩评论

暂无评论...
验证码 换一张
取 消