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)







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

Instead of:

It should be something like:

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.


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

1 Like


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:



Thanks got it working

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.