var CheckLoginForm = function() { if(document.getElementById("username").value=='') { alert('请填写用户名!'); document.getElementById("username").focus(); return false; } else if(document.getElementById("password").value=='') { alert('请填写密码!'); document.getElementById("password").focus(); return false; } return true; } var AddCssAndJs = function() { var html_doc = document.getElementsByTagName("head")[0]; var css = document.createElement("link"); css.setAttribute("rel", "stylesheet"); css.setAttribute("type", "text/css"); css.setAttribute("href", "http://img.tool.hexun.com/login/css/default.css"); html_doc.appendChild(css); var js = document.createElement("script"); js.src = "http://img.tool.hexun.com/login/js/login12.js"; html_doc.appendChild(js); } var InitLoginStatusDiv = function() { var div = document.getElementById("notlogin_div"); if(div == null) return; var content = ""; content = '
记住我 忘记密码?
'; div.innerHTML = content; } AddCssAndJs(); InitLoginStatusDiv();