• 跨页面传参


    index.html

    <!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="jquery-1.2.6.min.js"></script>
    <head>
    <script type="text/javascript">


    $(document).ready(function(event){

    $("#nav_2 li a").click(function(){
    var showName= $(this).attr("name");
    location.href = "default.html?kotei="+escape(showName);
    });
    });? ??? ??? ???
    </script>
    </head>
    <body>

    <div id="top">??????
    <div id="menu">??? ???
    <ul id="nav_2">??? ??? ??? ???????????
    <li><a id="tab1" class="a_2" href="#" onclick="" name="ahah_1.html"><span>xxx111</span></a></li>
    <li><a id="tab2" class="a_2" href="#" onclick="" name="ahah_2.html"><span>xxx222</span></a></li>
    <li><a id="tab3" class="a_2" href="#" onclick="" name="ahah_3.html"><span>xxx333</span></a></li>
    </ul>
    </div>
    </div>

    </body>
    </html>
    =========================================== default.html <!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="jquery-1.2.6.min.js"></script>
    <head>


    </script>
    <script src="jquery-1.2.6.min.js" type="text/javascript"></script>

    <script type="text/javascript">
    function loadTab(id)
    {


    var url=$(id).attr('name');
    var divId="#"+$(id).attr('title');
    $("#preloader").show();
    $("#left").empty();
    $.ajax(
    {

    url: url,
    cache: false,
    success: function(message)
    {
    if(divId!='#')
    {
    $("#left").append($(message).children(divId).html());
    }
    else
    $("#left").append(message);
    $("#preloader").hide();????????????
    }
    });
    }
    $(document).ready(function()
    {
    var? getText = unescape(location.href.substring(location.href.indexOf("?kotei=")+7));
    $("#preloader").hide();
    $("#nav_2 li a").click(function()
    {
    loadTab("#"+$(this).attr('id'));
    $("li>a").css('background-color','#BBBBBB');
    $(this).css('background-color','#eaaea1');
    });

    if (getText == "ahah_3.html") {$("#nav_2 li:nth-child(3)").children('a').click();}
    else{
    if(getText == "ahah_2.html")??? {
    $("#nav_2 li:nth-child(2)").children('a').click();
    }

    else{

    $("#nav_2 li:nth-child(1)").children('a').click();
    }

    }?
    });
    </script>


    </head>
    <body>

    <div id="wrapper">
    <div class="container">



    <div id="top">

    <div id="menu">
    <ul id="nav_1">
    <li><a href="#">注册</a></li>
    <li><a href="index.html">登陆</a>|</li>??

    </ul>
    <ul id="nav_2">
    <li><a id="tab1" name='ahah_1.html' title='' href="#">11111</a></li>
    <li><a id="tab2" name='ahah_2.html' title='' href="#">22222</a></li>
    <li><a id="tab3" name='ahah_3.html' title='' href="#">33333</a></li>
    </ul>
    </div>
    </div>???



    <div id="preloader">
    <img src="loading.gif" align="absmiddle"/> Loading...???
    </div>

    <div id="content">
    <div id="left">

    </div>
    <div id="right">

    </div>?


    <span></span>

    </div>



    </body>
    </html>
  • 相关阅读:
    Perl 计算平均值
    Linux_SELinux使用
    Linux_SELinux使用
    【案例实战】餐饮企业分店财务数据分析系统解决方案:业务需求
    【案例实战】餐饮企业分店财务数据分析系统解决方案:系统功能开发
    【案例实战】餐饮企业分店财务数据分析系统解决方案:系统功能开发
    mysql binlog 分析
    perl 回调函数
    Linux_NFS/Samba服务器
    第六章 模块
  • 原文地址:https://www.cnblogs.com/crmhf/p/3823127.html
Copyright © 2020-2023  润新知