最近的工作有一部分是维护一个用动网的论坛。有一天需要在进入一些板块(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" ) ;
}
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" ) ;
}