geel

要有耐心

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
最近的工作有一部分是维护一个用动网论坛。有一天需要在进入一些板块(list.asp)的时候弹出窗口。开始想在代码上动手脚,不过想想动网那代码和没准哪天升级,还是决定在模板里插代码。
// Base functions.
function getCurrentPage() {
   thisURL 
= document.URL;
   thisPage 
= thisURL.substring( thisURL.lastIndexOf("/") );
   
return thisPage;
}

function popPage(page,url) {
  thisPage 
= getCurrentPage();
  
if (thisPage == "/") {thisPage = "/index.asp";}
  
if ( thisPage == page ) {
     window.open(url);
  }
}

function l(boardid) {
    
return (getCurrentPage()=="/list.asp?boardid="+boardid)?true:false;
}
if( l(1)||l(3)||l(6)||l(7) )
{
   popPage( getCurrentPage(), 
"URL" ) ;
}
posted on 2004-10-24 22:43  geel  阅读(1044)  评论(0编辑  收藏  举报