我有这个目录结构如图所示
在www文件夹内,如图所示(www文件夹命名约定,根据phonegap要求)有两个项目
客户文件夹
ORcapture.html
从ORcapture.html我重定向到客户文件夹下的html页面
window.location =" customer / index.html?qruuid =" + uuid;
我的问题是
从customer / index.html文件中我如何重定向回ORcapture.html ??
请告诉我如何在这种情况下重定向?
答案 0 :(得分:2)
你应该使用../.
window.location = "../capture.html";
答案 1 :(得分:1)
嗯,如果可能的话,最好使用绝对URL。在您的示例中,它将是:
window.location = "/customer/index.html";
和
window.location = "/ORcapture.html";
如果您仍想使用相对URL,则可以使用../
(而不是/
表示父目录,这表示根目录),因此另一个将是:
window.location = "../ORcapture.html";
但是只能使用比html文件深一层的网址(与绝对网址相比,无处不在)。
答案 2 :(得分:0)
window.location = "../ORcapture.html";