如何将以下格式转换为普通网址?例如,改变这个:
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>