我想要在新標籤頁/窗口中打開菜單URL,我不希望它用所需的URL覆蓋當前頁面。消息標題被代碼塊「幫助」所掩蓋。只是爲了表明:我使用_blank
,瀏覽器忽略它。爲什麼HTML窗體菜單在同一窗口/選項卡中打開URL?
<FORM name="Menu_1a">
<SELECT name="URL" onChange="if(options[selectedIndex].value)
window.location.href=(options[selectedIndex].value) " style="background-color: #CCFF99; font-weight: bold;">
<option value="" selected="selected" style="background-color: #FFCC99; font-weight: bold;">---Select --></option>
<OPTION value="http://ezaca.tripod.com/index_acco.html" target="_self">Reset this menu</OPTION>
<!-- this works, except it replaces page instead of opening new -->
<OPTION value="http://www.jakob-schlaepfer.ch/en/decor/collection-a-m/" target="_blank">Background</OPTION>
<OPTION value="http://lyricstranslate.com/en/amor-eterno-love-eternal.html">Amor Eterno - Lyrics</OPTION>
<OPTION value="http://www.youtube.com/watch?v=7QuXKirNX3I">Amor Eterno - R. Durcal</OPTION>
<OPTION value="http://earthquake.usgs.gov/earthquakes/recenteqsww/Maps/10/260_15.php">Quakes Acapulco</OPTION>
<OPTION value="http://www.emsc-csem.org/#2w/" target="_blank">Quakes terremoto</OPTION>
<OPTION value="http://acapulcodejuarez.olx.com.mx/item_page.php?Id=280315985&ts=1321310362/" target="_blank">Advertising - Emilio</OPTION>
<OPTION value="http://ezaca.tripod.com/acco/sndass/ezlxsndass.html" target="_blank" style="background-color: #FFCC99; font-weight: bold;">Soundassistent for Limex Midi</OPTION>
<OPTION value="http://ezaca.tripod.com/acco/sndass/ezlxsndass.html" target="_blank" style="background-color: #FFCC99; font-weight: bold;">Klangassistent für Limex Midi</OPTION>
<OPTION value="http://ezaca.tripod.com/acco/lx_1.htm/#top0">Limex Midi Erfahrungen</OPTION>
<OPTION value="" style="background-color: Yellow; font-weight: bold;"></OPTION>
</SELECT>
</FORM>
代碼看起來沒事,你測試了谷歌瀏覽器? – yanguya995
上面的代碼確實在當前窗口「window」中打開了一個新頁面。你說你使用'_blank',但是,呃,在哪裏? –