我的用cols判断的:
if(top.document.all("fstMain").cols== "20,150,*")另外最好不要这样写"0,10,80%"应该写成"0,10,*"

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function change()
    {
    if(zuo.style.display=="none")
    {
    zuo.style.display="";
    dot.innerText="<<"; }
    else
    {
    zuo.style.display="none";
    dot.innerText=">>";
    }
    }
    //-->
    </SCRIPT>
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" height="400" style="font-size:12px">
      <tr> 
        <td width="200" valign="top" bgcolor="#FF9966" id="zuo">&nbsp;</td>
        <td width="10" align="center" bgcolor="#FFCC00" style="cursor:hand" onclick="change();" id="dot"><<</td>
        <td valign="top" bgcolor="#669900">&nbsp;</td>
      </tr>
    </table>
      

  2.   

    我发现了出问题的关键地方了,是下面几句: var str=this.location.href; //当前页面的路径 
     var u=str.indexOf("/");
     var new_str=str.substring(0,u);我原本是用这几句来取类似http://www.sina.com.cn/这样的地址,结果只得到了http:继续想怎么得到第三个“/”符号之前的字符数。
      

  3.   

    怎么得到第三个“/”符号之前的字符数这个问题解决了,但现在能收缩,却不能展开,也没有报错信息,不知为何,望朋友们继续指点: <SCRIPT language="javascript">
    <!--

    function switchSysBar() 

        //
    //获取页面路径
    //
    var path = "";
    var href = document.location.href;
    var s = href.split("/"); 
    for (var i=2;i<(s.length-1);i++) {
    path+=s[i]+"/";
    }
    i=s.length-1;
    path=s[1]+s[2];
    var url = window.location.protocol + "//" + path+"/";

    if (top.document.all("fstMain").cols = "166,10,*")
    {

    switchPoint.src=url+"images/ArrowRight.gif";
    top.document.all("fstMain").cols = "0,10,*"; 
    }
    else
    {     
    switchPoint.src=url+"images/ArrowLeft.gif";
    top.document.all("fstMain").cols = "166,10,*"; 
        
    }  
        

    -->
    </SCRIPT>
      

  4.   

    从http://www.sina.com.cn/的第8个开始搜索不就可以了,如果有SSL则从第九个var u=str.indexOf("/",7);
      

  5.   

    从http://www.sina.com.cn/的第8个开始搜索不就可以了,如果有SSL则从第九个var u=str.indexOf("/",7);