jquery/ajax issue, need help
I've been tweaking a jquery script for a while and everything was great until a few hours ago. I have very basic knowledge when it comes to ajax and I can't figure this out by myself so hopefully someone can help me out..
I have a main index.php file that contains <li> elements inside, each <li> represents a part of the website (using ajax) like this:
<ul id='dList'> <li id='home'> content </li> </ul>
$(document).ready(function() { $.get('bin/dlist.php', function(dList) { $('#dList').append(dList); $('.load').each(function() { $(this).load($(this).attr('id') + '/index.php #loadContent'); }) }); });
<li id='about' class='load'></li>
<li id='products' class='load'></li>
<li id='contact' class='load'></li>
each of those folders has its own index.php file with a div element which ID is #loadContent (thats the part i want to load inside each li element)
so my jquery code turns this
<ul id='dList'> <li id='home'> content </li> </ul>
<ul id='dList'> <li id='home'> content </li> <li id='about' class='load'> #loadContent </li> <li id='products' class='load'> #loadContent </li> <li id='contact' class='load'> #loadContent </li> </ul>
to access each section I use hash tags like this: domain.com/#about (that only shows the 'about' <li> element)
ok so that is working fine BUT the problem is I can only see my website once, every time I try to access it again (without clearing the browser cache) it won't look good, I don't understand why it only looks good once, is there something wrong with my little piece of code?
sorry that i can't give a link but I don't have a hosting for it yet, I've been testing it offline with xampp (to test php websites offline)
I read earlier that it may be due to the browser caching my website, but tried every solution to disable cache and it still won't work
Advice please? I need help on this one!
-sp
Want a website, native Android app, or web app? Talk to me.
http://lastingwebdesign.com
Want a website, native Android app, or web app? Talk to me.
http://lastingwebdesign.com