views:

14

answers:

2

Hello There,

I am using a jquery function to take the value of the hash tag in the URL and load that URL into a div id'd 'inload_content'. As seen at http://www.divethegap.com/update/community/ (# When testing only use the 2 test videos at the bottom as the others are not connected to URLs yet.

In Safari this works perfectly both on OSX and IOS. In firefox it will load the one called Test Video, but as soon as you load Test Video 2 it does not matter what you do it will only load Test Video 2 without a refresh of the entire page.

In IE 8 it does not do anything at all.

Any Ideas,

Many Thanks.

A: 

You could try including the full URL in your load function...

load('http://mysite.com/' + location.hash.substring(1))

I've had similar problems in the past.

fudgey
A: 

Problem solved in 3 steps.

Step 1 Check to make sure that there is not a critical repetition of an ID in a data driven site caused by there being one more post and the container ID being inside it. (in this case 'nav' was inside the Loop.

Step 2 Stick to the original code as in this case the hash tag is an entire URL from http to the final slash so the code needed is most definitely.

$(function() { if(location.hash) $("#content_inload").load(location.hash.substring(1)); $("#nav a").click(function() { $("#content_inload").load(this.hash.substring(1));

}); });

Step 3

Postulate on all reasons why something like this wont work from basic html spelling mistake to inner script order and then eliminate each problem one by one.

Robin Knight