Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.setInterval(function() {
- $.getJSON("/news/newscount?newsid=" + newsid, function(n) {
- if (n.count > 0) {
- var t = document.querySelector("link[rel*='icon']") || document.createElement("link");
- t.type = "image/x-icon";
- t.rel = "icon";
- t.href = "//img.ithome.com/img/favicon_news_yellow.ico";
- t.mce_href = "//img.ithome.com/img/favicon_news_yellow.ico";
- document.getElementsByTagName("head")[0].appendChild(t);
- t = document.querySelector("link[rel*='shortcut icon']") || document.createElement("link");
- t.type = "image/x-icon";
- t.rel = "shortcut icon";
- t.href = "//img.ithome.com/img/favicon_news_yellow.ico";
- document.getElementsByTagName("head")[0].appendChild(t);
- $("#nmsg").text("有 " + n.count + " 篇文章更新,点击查看");
- $(".pmsg").show()
- }
- })
- }, 3e5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement