2016-07-23 8 views
1

メニュー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&uuml;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>

+0

コードは、Googleクロームでそれをテストして、大丈夫に見えますか? – yanguya995

+0

上記のコードは、現在のウィンドウである 'window'に新しいページを開きます。あなたは '_blank'を使うと言うが、どこに? –

答えて

0

あなたがフォームに属性target="_blank"を追加する必要が新しいウィンドウでformを提出することができます。

ターゲット属性は、名前やフォームの送信後に受信された応答を表示する場所を示すキーワードを指定します。

target属性は、参照コンテキスト(タブ、ウィンドウ、またはインラインフレームなど)の名前またはキーワードを定義します。

http://www.w3schools.com/tags/att_form_target.asp

<FORM name="Menu_1a" target="_blank"> 
 
    <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&uuml;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>

+0

私はコードをマークし、ctrl + kを使用しました。それは以前のレイアウトとは違って見えます。 2016.07.26。このフォーラムの運営は、20年のオンライン体験にもかかわらず、私にとってはまだ奇妙です。私は私の追加が失われないことを望む、私は編集されたテキストの送信ボタンを見つけることができません。 – Morphingstar

+0

申し訳ありませんが、分かりません。 –

関連する問題