zoukankan      html  css  js  c++  java
  • 多个页面引用同一个Html片段(转载)

    <script type="text/javascript">
    02     $(function() {
    03         $("#clickToInsert").click(function() {
    04             $.getScript("pages2_2.js", function() {
    05                 $.get("service.ashx?file=pages2_3.txt", function(data) {
    06                     $("#placeholder").html(data);
    07                 }, "text");
    08             });
    09         });
    10     });
    11 </script>
    12 <input type="button" id="clickToInsert" value="Insert HTML" />
    13 <div id="placeholder">
    14 </div>
     
    <script type="text/javascript">
    02     $(function() {
    03         $("#clickToInsert").click(function() {
    04             $.get("service.ashx?file=pages2_4.txt", function(data) {
    05                 $("#placeholder").html(data);
    06             }, "text");
    07         });
    08     });
    09 </script>
    10 <input type="button" id="clickToInsert" value="Insert HTML" />
    11 <div id="placeholder">
    12 </div>

    pages2_4.txt:
    01 <script src="pages2_2.js" type="text/javascript"></script>
    02 <script type="text/javascript">
    03     setup();
    04 </script>
    05 <div id="complex_page_segment">
    06     <input type="button" value="Previous Page" class="previous" />
    07     <input type="button" value="Next Page" class="next" />
    08     <div class="content">
    09         Page Content</div>
    10 </div>
     
    转自:http://www.cnblogs.com/sanshi/archive/2009/08/14/1546317.html
  • 相关阅读:
    R
    P
    O
    M
    二分算法的一些思考
    I
    H
    G
    5-46 新浪微博热门话题 (30分)——unfinished HASH
    BZOJ 1179: [Apio2009]Atm
  • 原文地址:https://www.cnblogs.com/johnwonder/p/1742018.html
Copyright © 2011-2022 走看看