function GetQueryValue(name)    
{           
var   reg=new   RegExp("(^|&)"+   name   +"=([^&]*)(&|$)");           
var   r=window.location.search.substr(1).match(reg);           
if   (r!=null)   return   unescape(r[2]);           
return   "";       
}
var ww=GetQueryValue("value")

解决方案 »

  1.   

    left.html<html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <title>Untitled Document </title> 
    </head> 
    <body> <table> 
    <tr> <td valign="left"> <a href="1.html?value=1" target="content">1 </a> </td> </tr> 
    <tr> <td valign="left"> <a href="1.html?value=2" target="content">2 </a> </td> </tr> 
    </table> </body> 
    </html> 1.html
    <script type="text/javascript"> 
    var ww=false;
    //function:get value after ie address's '?'
    //use this function:show.htm?id=2 get 'id' value use QueryString("id")
    function QueryString(qs)
    {
    s = location.href;
    var SharpIndex=s.indexOf("#");
    if (SharpIndex!=-1) {
    s=s.substring(0,SharpIndex);
    }
    s = s.replace("?","?&").split("&");
    re = "";
    for(i=1;i<s.length;i++)
    {
    if(s[i].indexOf(qs+"=")==0)
    {
    re = s[i].replace(qs+"=","");
    }
    }
    return re;
    }function init(){
    ww=QueryString("value");

    </script> 
      

  2.   


    function init(){var ww = location.search.replace(/^.*\D(\d+)$/, '$1')}[html]
    <script>
    function init(){var ww = location.search.replace(/^.*\D(\d+)$/, '$1'); alert(ww);}
    init();
    </script>
    [/html]
      

  3.   

    非常感谢各位,我要结贴了。大家提供了很多方法,都很管用。只要不放在加载里。index.html <html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <title>Untitled Document </title> 
    </head> 
    <frameset frameborder="1" cols="30%,*"> 
    <frame name="left" src="left.html"> 
    <frame name="content" src=""> 
    </frameset> 
    <body> </body> 
    </html> left.html <html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <title>Untitled Document </title> 
    </head> 
    <body> <table> 
    <tr> <td valign="left"> <a href="1.html?1" target="content">1 </a> </td> </tr> 
    <tr> <td valign="left"> <a href="1.html?2" target="content">2 </a> </td> </tr>
    </html> 1.hmtl <html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <title>Untitled Document </title> 
    </head> 
    <script language="JavaScript"> 
    var ww = location.href.match(/[^?]+$/);
    or
    var ww=document.URL.match(/[^?]+$/);
    or
    ww = location.search.replace(/^.*\D(\d+)$/, '$1'); 
    </script> 
    <body onLoad="init()"> 
    <form method="post" name="f1"> 
    <script language="javascript" type="text/javascript"> 
    if(ww==1){document.write(' <input id=uiViewApplyButton type=button value="123">&nbsp;');} 
    else if(ww==2){document.write(' <input id=uiViewApplyButton type=button value="456">&nbsp;');} 
    else{document.write(' <input id=uiViewApplyButton type=button value="000">&nbsp;');} 
    </script></form> </body> </html>如果还含有标记:left.html <html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <title>Untitled Document </title> 
    </head> 
    <body> <table> 
    <tr> <td valign="left"> <a href="1.html?value=1" target="content">1 </a> </td> </tr> 
    <tr> <td valign="left"> <a href="1.html?value=2" target="content">2 </a> </td> </tr>
    </html> 1.hmtl <html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <title>Untitled Document </title> 
    </head> 
    <script language="JavaScript"> 
    function GetQueryValue(name)    
    {           
    var   reg=new   RegExp("(^|&)"+   name   +"=([^&]*)(&|$)");           
    var   r=window.location.search.substr(1).match(reg);           
    if   (r!=null)   return   unescape(r[2]);           
    return   "";       
    }
    var ww=GetQueryValue("value");
    orfunction QueryString(qs)
    {
        s = location.href;
        var SharpIndex=s.indexOf("#");
        if (SharpIndex!=-1){s=s.substring(0,SharpIndex);}
        s = s.replace("?","?&").split("&");
        re = "";
        for(i=1;i<s.length;i++){if(s[i].indexOf(qs+"=")==0){re = s[i].replace(qs+"=","");}}
        return re;
    }
    var ww=QueryString("value");
    </script> 
    <body onLoad="init()"> 
    <form method="post" name="f1"> 
    <script language="javascript" type="text/javascript"> 
    if(ww==1){document.write(' <input id=uiViewApplyButton type=button value="123">&nbsp;');} 
    else if(ww==2){document.write(' <input id=uiViewApplyButton type=button value="456">&nbsp;');} 
    else{document.write(' <input id=uiViewApplyButton type=button value="000">&nbsp;');} 
    </script></form> </body> </html>