如何使Firefox在url或文件路径中使用相同的正斜杠和反斜杠? [英] How to make Firefox treat forward and back slashes the same in url or file-paths?
本文介绍了如何使Firefox在url或文件路径中使用相同的正斜杠和反斜杠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法使Firefox在URL或本地文件路径中将\对待/像\,反之亦然(将其重写)?通过调整,附加或其他方式?
Is there a way to make Firefox treat / like \ and vice versa in the url or local file path (rewrite it)? Through a tweak, add-on, or anything?
- 这与某些本地页面和某些文件中的链接有关.
P.S. IE和Chrome中已经存在这种行为.
推荐答案
以下内容可能会对您有所帮助:
here's something that might help you:
<html>
<head>
<script language="javascript">
function onload() {
var list=document.getElementsByTagName("A");
for(i = 0; i < list.length; i++)
{
if (list[i].href != null && list[i].href.length > 2 && list[i].href.substring(2,1) == ":") {
list[i].href = "file:///"+list[i].href.replace(/\\/g, '\/');
}
}
}
</script>
</head>
<body onload="onload();">
<a href="D:\Perso\gwt/eclipse"> hey you </a>
</body>
</html>
在IE,Chrome,Safari和FF上进行了测试
Tested on IE, Chrome, Safari and FF
这篇关于如何使Firefox在url或文件路径中使用相同的正斜杠和反斜杠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文