• 将 html 代码写入 js 文件中,然后在网页中引用此 js 文件,实现头模板重用



    首先在 index.aspx 文件中:

    <body>
    <script language="JavaScript" src="js/hrall_head.js"></script>

    这样引用 js 文件

     js 文件代码:

    document.write("<table width='837' border='0' align='center' cellpadding='0' cellspacing='0'>");
    document.write(
    "<tr>");
    document.write(
    "<td height='34'>");
    document.write(
    "<table width='310' border='0' cellspacing='0' cellpadding='0'>");
    document.write(
    "<tr>");
    document.write(
    "<td width='3'><img src='http://hr.visionunion.com/images/toptit1.gif' width='3' height='20'></td>");
    document.write(
    "<td bgcolor='#EFF2F3' align='center'><img src='http://hr.visionunion.com/images/spacer.gif' width='1' height='3'><br><strong><a href='http://www.visionunion.com/' class='12greys'>视觉同盟</a> | <a href='http://hr.visionunion.com' class='12greys'>人才网首页</a> | <a href='http://hr.visionunion.com/person/position_search.php' class='12greys'>设计师入口</a> | ");
    document.write(
    "</td>");
    document.write(
    "<td bgcolor='#EFF2F3' align='center'><a href='http://hr.visionunion.com/fabujianli.htm' target='_blank'><img src='http://hr.visionunion.com/images/topbarbtnrue.gif' border='0'></a></td>");
    document.write(
    "<td width='3'><img src='http://hr.visionunion.com/images/toptit2.gif' width='3' height='21'></td>");
    document.write(
    "</tr></table></td>");
    document.write(
    "<td width='302'>");
    document.write(
    "<table width='302' border='0' cellspacing='0' cellpadding='0'>");
    document.write(
    "<tr>");
    document.write(
    "<td width='162'><a href='http://hr.visionunion.com/sys/contact.htm'><img src='http://hr.visionunion.com/images/kefu.gif' border='0'></a></td>");
    document.write(
    "<td><a href='http://hr.visionunion.com/company/company_gate.php'><img src='http://hr.visionunion.com/images/btnqiye.gif' width='70' height='24' border='0'></a></td>");
    document.write(
    "<td>&nbsp;</td>");
    document.write(
    "<td width='70'><a href='http://hr.visionunion.com/company/position_issue.php'><img src='http://hr.visionunion.com/images/btnfabu.gif' width='70' height='24' border='0'></a></td>");
    document.write(
    "</tr></table>");
    document.write(
    "</td></tr></table>");
    document.write(
    "<table width='837' border='0' align='center' cellpadding='0' cellspacing='0'>");
    document.write(
    "<tr>");
    document.write(
    "<td width='200'><a href='http://hr.visionunion.com'><img src='http://hr.visionunion.com/images/logo.gif' alt='中国创意设计人才网' border='0'></a></td>");
    document.write(
    "<td background='http://hr.visionunion.com/images/topbarbg.gif' class='14white'><div align='right'><strong><a href='http://hr.visionunion.com/person/position_search.php' class='14white'><font color='#ffffff'>搜职位</font></a> | <a href='http://hr.visionunion.com/company/resume_search.php' class='14white'><font color='#ffffff'>搜简历</font></a> | <a href='http://hr.visionunion.com/person/production_list.php' class='14white'><font color='#ffffff'>设计作品</font></a> | <a href='http://hr.visionunion.com/sys/hunter.htm' class='14white'><font color='#ffffff'>设计猎头</font></a></strong></div></td>");
    document.write(
    "<td width='4'><img src='http://hr.visionunion.com/images/topbar2.gif' width='4' height='53'></td>");
    document.write(
    "</tr></table>");

    此 js 文件下载:

     /Files/tiger8000/hrall_head.js.txt

    因为 .js 文件上传不被接受,所以改了一下扩展名,下载后,去掉 .txt 就可以了

  • 相关阅读:
    【Python学习笔记之三】lambda表达式用法小结
    Cisco Packet Tracer 6.0 实验笔记
    Kali Linux 下安装中文版输入法
    kali 2018.1安装教程
    Kali Linux菜单中各工具功能大全
    互联网电商购物车架构演变案例
    互联网业务场景下消息队列架构
    物流系统高可用架构案例
    高并发下海量容器案例一
    客服系统微服务架构的演化
  • 原文地址:https://www.cnblogs.com/tiger8000/p/996163.html
Copyright © 2020-2023  润新知