页面写成js

要用到的地方这样写,例如:
<script>document.write("<scr" + "ipt src='login_right_one.php?id="+Math.random()+"'></scr" + "ipt>");</script>

login_right_one.php为包含要用到模板页的php文件,例如right_first_1.html
<!--模板页right_first_1.html文件-->
document.write("<div class='an_con_R_1_title'>登录答疑网</div>");
document.write("<div class='an_con_R_1_con'>");
document.write("<input type='button' class='input_b_9' value='' onclick='clik1()'/>&nbsp;&nbsp;");
document.write("<input type='button' class='input_b_10' value='' onclick='clik2()' /></div>");
document.write("</div>");
function clik1(){
window.location.href="login.php}
function clik2(){
window.location.href="register_student.php}

你可能感兴趣的:(js)