function navigateTo(sel, target, newWindow) {
var url = sel.options[sel.selectedIndex].value;
if (newWindow) {
window.open(url, target, '--- attributes here, see below ---');
} else {
window[target].location.href = url;
}
}
Change to URL X
Change to URL Y
目标的一些有用值可能是“窗口”(当前窗口)或“顶部”(打破框架集或iframe).如果你想打开一个新窗口,可以使用navigateTo(this,’someWindow’,true);
‘— attributes —‘的值使用here for Mozilla和here for IE记录的各种属性设置.例如:
'height=300,width=400,top=100,left=100,statusbar=0,toolbar=1'