Update tag.html

This commit is contained in:
Meekdai 2023-11-21 22:52:13 +08:00
parent 826850ccd8
commit 547d4137de

View File

@ -69,6 +69,7 @@ document.getElementById("{{ blogBase['singeListJson'][num]['postTitle'] }}").set
{%- endfor %}
tagList=[];
jsonData='';
let requestJson="blogBase.json"
let request=new XMLHttpRequest();
request.open("GET",requestJson);
@ -77,10 +78,10 @@ request.send();
request.onload=function(){
jsonData=JSON.parse(request.response);
console.log(jsonData);
showList(jsonData,window.location.hash.slice(1));
showList(window.location.hash.slice(1));
}
function showList(jsonData,tag){
function showList(tag){
let SideNav=document.getElementsByClassName("SideNav")[0];
let tagLable=document.getElementById("tagLable");
for(i in jsonData["postListJson"]){
@ -140,9 +141,9 @@ function showList(jsonData,tag){
function updateShowTag(label){
if(window.location.hash.slice(1)!=encodeURI(label)){
window.location.hash="#"+(label);
showList(jsonData,label);
showList(label);
console.log("change to "+label);
}
}
</script>