user974802
user974802

Reputation: 3457

How to redirect to HTML page present one level above folder

I have this directory structure as shown

enter image description here

Inside the www folder as shown in the figure (www folder naming convention as per phonegap requirement) there are two items

customer folder

ORcapture.html

From ORcapture.html i am redirecting to a html page present under the customer folder ths way

window.location = "customer/index.html?qruuid="+uuid;

My question is

From customer/index.html file how can i redirect back to ORcapture.html ??

Please let me know how to redirect in this case ??

Upvotes: 1

Views: 3332

Answers (3)

DotNet Fan
DotNet Fan

Reputation: 383

window.location = "../ORcapture.html";

Upvotes: 0

Shomz
Shomz

Reputation: 37701

Well, it's always best to use absolute URLs, when possible. In your example, it would be:

window.location = "/customer/index.html";

and

window.location = "/ORcapture.html";

If you still want to use relative URLs, you can denote a parent directory using ../ (instead of /, which denotes a root dir) so the other one would be:

window.location = "../ORcapture.html";

but that would work only with URLs which are one level deeper than that html file (as opposed to the absolute URLs, which work from everywhere).

Upvotes: 1

divakar
divakar

Reputation: 1379

You should use ../.

window.location = "../capture.html";

Upvotes: 3

Related Questions