如何在javascript中爲?
和=
製作正則表達式?javascript替換問號
我想從
http://localhost/search?search=words
東西
http://localhost/search/search/words
到(/搜索/)
<script>
var ss = "http://localhost/search?search=words".replace("/\?search\=/g", "/search/");
document.write(ss);
</script>
BTW(搜索=?):只是一些prastic ,而不是一個重寫。謝謝。
從鍵值對更改爲單個值目錄沒有任何意義,並且可以真正消除您已獲得的任何編碼。是的,你說過練習,但你究竟想在這裏完成什麼? – Incognito 2012-01-03 20:27:34