1

I am quite a newbie to jQuery/ajax but am having a problem with my site that im making.

Basically at first the page loads fine. On the boxes is a fade caption, when the title of the caption is clicked you are brought to an ajax page.

Once you use the 'Back' button on browser, or the 'Back to list' button i've made the caption fade plugin no longer works and the box i had previously clicked is no longer clickable.

can anyone help?

heres my website: http://www.jcianfrone.com/testing

jquery: h**p://www.jcianfrone.com/testing/script.js

HTML:

      <div id="pageContent">
        <div class="item"><a href="#page6"><img src="images/wrk-kd.jpg" width="286" height="200" alt="Koodikkki"></a><span id="caption"><a href="#">Title</a><p>Description</p></span></div>
        <div class="item"><a href="#page7"><img src="images/wrk-kd.jpg" width="286" height="200" alt="Koodikkki"></a><span id="caption"><a href="#">Title</a><p>Description</p></span></div>
        <div class="item"><a href="#page8"><img src="images/wrk-kd.jpg" width="286" height="200" alt="Koodikkki"></a><span id="caption"><a href="#">Title</a><p>Description</p></span></div>
        <div class="item"><a href="#page9"><img src="images/wrk-kd.jpg" width="286" height="200" alt="Koodikkki"></a><span id="caption"><a href="#">Title</a><p>Description</p></span></div>

     </div>

Many thanks in advance

Jason
  • 11
  • 1
  • What do you mean you are brought to an ajax page? Ajax is a technique that is used to retrieve information from the web server without reloading the page. – jamesmortensen Jan 09 '11 at 10:06
  • Excuse my incorrect wording, basically means a page that is called in using ajax. For example: http://www.jcianfrone.com/testing/index.html#page1 – Jason Jan 09 '11 at 10:12

2 Answers2

1

I believe the $(document).ready event isn't being called when you go back. I can't see what jQuery version you are using but try upgrading to the latest. If that doesn't work have a look at the answers on this post

Community
  • 1
  • 1
Stuart Burrows
  • 10,824
  • 2
  • 34
  • 33
  • Thanks for your response, I call the jQuery in at the bottom of the page for faster html loading, I am using 1.3.2. Will take a look at that post you suggested. – Jason Jan 09 '11 at 10:14
  • @Jason - Actually, you're mixing 2 different versions of Jquery. – jamesmortensen Jan 09 '11 at 10:18
0

You have two different versions of JQuery imported on your page. This could cause undesired behavior. I'd suggest picking the latest and removing this script tag:

   http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js

There are also Jquery plugins that will let you use the back button. It's possible that what you're doing isn't calling functionality to replace your original content. But I'd first start by making sure you tie up all your loose ends and get rid of duplicate script loading.

http://www.yarontadmor.co.cc/hijax.php

jamesmortensen
  • 33,636
  • 11
  • 99
  • 120
  • Thanks for your response, I have already tried with removing that line of code. This Hijax plugin looks promising, will investigate now. Thanks for your help. – Jason Jan 09 '11 at 10:27
  • @Jason - Irregardless of whether or not that's causing your problem, you should still only have one version of JQuery loaded on your site if you want to avoid conflicts or unusual behavior. How do you know which one you're really using? – jamesmortensen Jan 09 '11 at 10:40