views:

138

answers:

1

Hi,

UPDATE

I have now managed to get it working in both Firefox and Safari on Mac OS X but for some reason, it's still not working in Google Chrome 5.0.375.125.

Could it possibly be related to this thread in the jQuery forums about Google not working properly on a file system url but will work when hosted on a server, i.e. see: jQuery Forum

====================

Can anyone please assist as to why my website is not rendering properly in both Chrome and Safari but seems to work fine in Firefox, based on the following jQuery code/function I got from here

The issue seems to be with my mc-banner div - by having this code below, it doesn't actually render this div at all in Chrome or Safari which then mucks up the rest of my page.

// Check for hash value in URL  
var hash = window.location.hash.substr(1);  
var href = $('#themenu li a').each(function(){  
  var href = $(this).attr('href');  

  if(hash==href.substr(0,href.length-5)){  
    var toLoad = hash+'.html #mc-banner';  
    $('#mc-banner').load(toLoad)  
  }  
});  

$("#themenu li a").click(function(){                      
  var toLoad = $(this).attr("href")+" #mc-banner";   

  $('#mc-banner').fadeIn('slow',loadContent); 

  window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);  

  function loadContent() {  
    $("#mc-banner").load(toLoad); 
  }  

  return false;
});

When I remove this code, all works fine in both Chrome and Safari.

Am I missing something?

Thanks.

A: 

Hi,

I am having trouble getting jquery .load() to work in Safari and Chrome too, works fin in Firefox. Can you tell me how you managed to make it work in Safari please?

Cheers

andy_broom