Update tag.html
This commit is contained in:
parent
826850ccd8
commit
547d4137de
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user