且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 JavaScript 检查 URL 中的 #hash?

更新时间:2023-11-27 11:52:58

位置哈希:

if(window.location.hash) {
  // Fragment exists
} else {
  // Fragment doesn't exist
}