2011-06-24 17 views
0

我想隱藏#workspace當網址是:jQuery的location.pathname

http://machine/_l/R/bases.aspx#bases=0

http://machine/_l/R/bases.aspx#bases=1

http://machine/_l/R/bases.aspx#bases=2

,我想保持#workspace當URL是

http://machine/_l/R/bases.aspx

我已經嘗試過下面的腳本,但那不起作用!

var url = location.pathname; 
if (url.indexOf('#bases=') >= 0) { 
    //inner column width 
    jQuery('#workspace').css('display', 'none'); 
} 

有什麼想法? 感謝和快樂的星期五。

回答

2

檢查location.hash而不是location.pathname