網址:http://localhost/back-office/index.php/staff/shopping
笨URI段的URL在末尾附加
當我改變我想要的網址應該是這樣的
http://localhost/back-office/index.php/staff/shopping/1
http://localhost/back-office/index.php/staff/shopping/2
爲我上改變事件寫JavaScript的每onchange事件的類別
function cat()
{
var x = document.getElementById('cat').value;
document.location = "shopping/" + x;
}
<select name="cate" id="cat" onchange="cat()">
<option value="0">Select Cateogry</option>
<?php
foreach($get_cat as $category)
{
echo "<option value=$category->categoryid>$category->category</option>";
}
?>
</select>
的javscript作品,但URL獲取附加像
http://localhost/back-office/index.php/staff/shopping/shopping/2
http://localhost/back-office/index.php/staff/shopping/shopping/shopping/shopping/shopping/shopping/1
在每個籠子下降盒子onchange事件URL被追加像這樣在最後。
我怎麼能解決這個
這是一個JavaScript的問題,而不是具體的笨。你可以編輯你的標籤嗎? –