AJAX and jQuery - How to locate files in a specific folder?

AJAX and jQuery - How to locate files in a specific folder?

Hi,

Since a few days I am into jQuery and I am getting the hang of it with the basics.
I have this script here which uses jQuery and AJAX - it makes you switch between pages without leaving the index page the user visits.

There were a few problems with the script but I manage to solve these. However, there's one problem left that prevents me from checking if everything works and to make the script run correctly: the script does not correctly locate the .html-files it requires to switch between pages.
The .html-files are located in a specific folder (../pages/), the same folder as the index-page. The reason why it cannot locate the files is, because I sorted all related files in specific folders (example: JavaScript in ../js/, CSS in ../css/ etc.).

There is probably a really easy code for that, but I wasn't able to find it. I'm a very beginner at both of these languages, so I'm sorry if this sounds extremely stupid.

Here is the script:

  1. jQuery(function($) {
  2.                           
  3.     var hash = window.location.hash.substr(1);
  4.     var href = $('nav li a').each(function(){
  5.         var href = $(this).attr('href');
  6.         if(hash==href.substr(0,href.length-5)){
  7.             var toLoad = hash+'.html #contentBox1.div';
  8.             $('#contentBox1.div').load(toLoad)
  9.         }                                           
  10.     });
  11.     $('nav li a').click(function(){
  12.                                  
  13.         var toLoad = $(this).attr('href')+' #contentBox1.div';
  14.         $('#contentBox1.div').fadeOut('fast',loadContent);
  15.         $('#load').remove();
  16.         $('.wrapper').append('<span id="load">LOADING...</span>');
  17.         $('#load').fadeIn('normal');
  18.         window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
  19.         function loadContent() {
  20.             $('#contentBox1.div').load(toLoad,'',showNewContent())
  21.         }
  22.         function showNewContent() {
  23.             $('#contentBox1.div').fadeIn('normal',hideLoader());
  24.         }
  25.         function hideLoader() {
  26.             $('#load').fadeOut('normal');
  27.         }
  28.         return false;
  29.        
  30.     });
  31. });

I hope you guys can help me out and I have been clear enough with everything I put in this post.