Cant get the right path to link two webpages

I am trying to link a button to another html page through jquery but i cant seem to get the right path,
The two pages are in the same folder but i have the second page in a sub folder(past project),

Trying to link a button located in the first pic to the page indexStore.html(last pic)

Here’s what i tried:

$('#HomeToStoreButton').click(function () {
    window.location.href = '..\..\startbootstrap-shop-homepage-gh-pages\startbootstrap-shop-homepage-gh-pages\indexStore.html';
    return false;
});

Not the best way of showing the path but thats all i could think off.

Loction of js file(first pic)

image

image

image

image

image

Thanks.

Hi, what you have is a system’s file path and not a valid URL.

Instead of:
…\startbootstrap-shop-homepage-gh-pages\startbootstrap-shop-homepage-gh-pages\indexStore.html

It should be something like:
/startbootstrap-shop-homepage-gh-pages/startbootstrap-shop-homepage-gh-pages/indexStore.html

It needs an absolute path from the public root of your website’s server (where index.html is), and note too the forward slashes instead of the backward ones.

4 Likes

Semanticly speaking, this should be a link if it’s only function is to go to a new page.

1 Like

[off-topic]

I have recently struggled trying to make a site that uses Ajax to be more secure by including a href above-the-root :frowning: It was a big relief when “the penny dropped” to realise my mistake :slight_smile:

[/off-topic]

2 Likes

Thanks got it working

1 Like