1

when trying to go back one folder via ../ from a file "index.html" to the "index.html" in the folder before (also root folder) jQuery puts out "Error Loading Page".

My file structure looks something like this:

index.html -> main page /Something/index.html -> page where i want to place the link

I've already tried it on a file that does not include jQuery and it worked. with some text, however it does not allow me to do that in my current "index.html"

<a class="something" href="../index.html"> <img src="../images/logo.jpg"> </a> 

I want to go back to the index.html from /something/index.html.

5
  • <a class="something" href="mySite.site/Somthing/index.html"> <img src="../images/logo.jpg"> </a> Commented Aug 8, 2019 at 18:22
  • the problem is that although my page will go online as long as it is offline i cant use full urls and would like to keep hrefs relative! Thanks though! Commented Aug 8, 2019 at 18:28
  • what you did seems ok, I just tested it on my machine and it works normally. You have some other problems as you said maybe something related to jQuery. Can you show us the entire code of the root index please ? Commented Aug 8, 2019 at 18:31
  • thats my whole code in the index.html in root folder: jsfiddle.net/hzst38eu/2 Commented Aug 8, 2019 at 19:12
  • maybe i should note that im also using the bulma css framework i do not know if that could interfere with the link? Commented Aug 8, 2019 at 19:24

1 Answer 1

0

Thankfully I found the answer, it was more trivial than thought.

I just had to change

<a id="homebtn" class="navbar-item" href="../index.html"> <img src="../images/logo.jpg"> </a> 

to

<a id="homebtn" class="navbar-item" rel="external" href="../index.html"> <img src="../images/logo.jpg"> </a>, 

apparently the 'rel="external"' gives jQuery the info to not search inside the current file.

Answer found here: https://www.gajotres.net/how-jquery-mobile-page-handling-affects-javascript-executions/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.