Jump to content
Killersites Community
Rich528

IWD - HTML Ch4.8 - Problem with code??

Recommended Posts

Hi 

I am currently working through the IWD course. I am on Chapter 4 part 8 (Paths).

I have followed the instructions exactly but I cannot get the ../ part of the code to navigate up a directory when attempting to link back to the index.html page. 

I have saved the code in Sublime Text and refreshed the page in the browser but all I get is the 'Your file was not found' page. 

The link to the Friends page from the Index page works fine but not the other way around.

I have attached a screenshot containing the code and the file structure. The my_friends.html file is in the sub_pages folder.

Any help much appreciated, it was all going very smoothly until this.

Thanks

Rich

Screenshot.png

Edited by Rich528

Share this post


Link to post
Share on other sites

Hi Rich,

Paths are one of the big hurdles in learning web coding. So don't let it get to you.

Suggestion:

Based on what I see in your code and directory screenshot, you are simply not placing your files in the proper directories. So, in your code, you are telling the web browser with this code: 

../

... That the index page is in a directory above the current page. So place your friends.html page in a sub directory and be sure you index page is above that. To test this out and to learn, first get your links working where all your pages are in the same directory.

Stef

Share this post


Link to post
Share on other sites

Hi Stef

Thanks for the quick reply. 

The my_friends.html file is in the folder 'sub_pages' which is a sub-directory of where index.html is. I had all the links working fine when the pages were all in the same directory. I even have the Friends link in the index.html page linking to the friends.html page in the sub-pages folder without any issues so I think the file/folder structure is correct. I just cannot get the link to work going back in the other direction i.e. from friends.html (in the sub_pages folder) back to index.html in the main folder one directory above.

The directories are set up exactly as shown in the tutorial video (I think - unless I am missing something)?

Thanks

Rich

Share this post


Link to post
Share on other sites

Hi Stef

I solved the problem.

The tab in Sublime Text where I was editing the my_friends.html code was not affecting the code in the sub_pages folder for some reason. When I checked the source code from the web page itself the ../ was not present even though it was in the code editor.  Once I closed the tab and dragged it back into Sublime Text from the sub_pages folder it all began to work fine.

Thanks for your help.

Rich

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×