function loadM()
{
var l = window.location.toString();var u = l.split("/");    
      
return u[3];    
}theWebOffice.WebUrl="http://"+window.location.hostname+"/"+loadM()+"/OtherSource/UCMLOfficeServer.aspx";    //在这里取m这个值

解决方案 »

  1.   

    function mm()
    {
      if(/http:\/\/[^/]+\/([^/]+)\//i.test(location.href)) return RegExp.$1;
      return "";
    }theWebOffice.WebUrl="http://"+ location.hostname +"/"+ mm() +"/OtherSource/UCMLOfficeServer.aspx";
      

  2.   

    function aa()
    {
    var l = window.location.toString();var u = l.split("/");    
          
    var m = u[3];    //获取值赋值给m 
    return m;
    }
    theWebOffice.WebUrl="http://"+window.location.hostname+"/"+aa()+"/OtherSource/UCMLOfficeServer.aspx";    //在这里取m这个值