What is the problem of using location.href and location.reload at the same time?

let type=item.type,
url = location.protocol + "//" + location.host + "/web/"+type+"/show.html-sharp/" + this.activity.activity_id+"/"+undefined+"/"+this.yiye.activity_id;
location.href = url;

when the type changes above, the page jumps normally, but only when the hash changes, the page will not be refreshed, so I add the following sentence

location.reload();

now the hash value has changed, and the page will be refreshed, but when the type changes, the page will not jump and just refresh. What is the reason for this?

let pathname =location.pathname
location.href = url;
if(url.indexOf(pathname)!==-1){
   location.reload();
}

in the end, I solved the problem by judging whether the path has changed to call reload ()

.
Mar.19,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaebde-47fd1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaebde-47fd1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?