diff --git a/public/home/home.js b/public/home/home.js index d262fd141..17927d65d 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -32,7 +32,6 @@ var swiperRepo = new Swiper(".homepro-list", { }, }); - var output = document.getElementById("newmessage"); var socket = new WebSocket("ws://" + document.location.host + "/action/notification"); @@ -45,10 +44,12 @@ var maxSize = 20; var html =document.documentElement; var lang = html.attributes["lang"] var isZh = true; -if(lang != null && lang =="en-US" ){ +if(lang != null && lang.nodeValue =="en-US" ){ + console.log("the language is " + lang.nodeValue); isZh=false; +}else{ + console.log("default lang=zh"); } -console.log("the language is " + lang); socket.onmessage = function (e) { var data =JSON.parse(e.data) @@ -364,8 +365,7 @@ function displayRepo(json){ if(record["Topics"] != null){ for(var j = 0; j < record["Topics"].length; j++){ topic = record["Topics"][j]; - url = "/explore/repos?q=" + topic + "&topic=" - url = escape(url); + url = "/explore/repos?q=" + escape(topic) + "&topic=" html += "" + topic + ""; } }