如何將下面的格式轉換成普通的url?例如,更改此:正則表達式html url默認
example.com\/1233612\/201307\/202111\/1039127998001_2534751409001_1193-1-h.mp4
到
example.com/1233612/201307/202111/1039127998001_2534751409001_1193-1-h.mp4
編輯:
我都試過,但我仍然無法刪除\
斜線:
<script type="text/javascript">
function encode() {
var obj = document.getElementById('dencoder');
var unencoded = obj.value;
obj.value = encodeURIComponent(unencoded).replace(/'/g,"%27").replace(/"/g,"%22");
}
function decode() {
var obj = document.getElementById('dencoder');
var encoded = obj.value;
obj.value = decodeURIComponent(encoded.match('file=(.*?)($|&)')[1]);
window.open(obj.value);
}
</script>
什麼語言? –
對不起.in javascripts – d3bug3r
你有什麼嘗試?你有沒有任何示例代碼供我們使用?你得到的錯誤是什麼? – 2013-09-25 02:13:47