zoukankan      html  css  js  c++  java
  • 将 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 就可以了

  • 相关阅读:
    8.移动和重命名文件
    7.复制文件和目录
    22.变基
    21.拉取&删除远程分支
    程序员必备课程——网络编程入门
    正则表达式——Java程序员懂你
    编程语言的基础——搞定JavaIO
    需加装饰——装饰模式
    结合提供者模式解析Jenkins源码国际化的实现
    算法族的集中管理——策略模式
  • 原文地址:https://www.cnblogs.com/tiger8000/p/996163.html
Copyright © 2011-2022 走看看