2011-09-09 75 views
0

我無法使我的列表框鏈接正常工作。我在這個網站上找到了下面的代碼,但是當我在瀏覽器中預覽它時,鏈接適用於我選擇的第一個選項,但如果我嘗試第二個選項,瀏覽器會告訴我它找不到該頁面。如何使用JavaScript在<option>標記中包含鏈接

<select onchange="javascript:handleSelect(this)"> 

<option value="../Pages/Examples of Business plans/Business plan samples">Agriculture</option> 
<option value="../Pages/Examples of Business plans/Business plan samples">Automotive</option> 
<option value="../Pages/Examples of Business plans/Business plan samples">Hospitality</option> 

</select> 

        <script type="text/javascript"> 
        function handleSelect(elm) 
        { 
        window.location = elm.value+".php"; 
        } 
        </script> 

回答

0

該文件不存在於該目錄中。

即沒有名稱爲「elm控件的值」的文件,並且在其中使用的代碼目錄中附加了「.php」。

相關問題