views:

216

answers:

2

$(document).ready(function(){
$("#home_tab").click(function(){
$("#content").hide();
$("#content").load("php/media_body.php");
$("#content").show("slow"); });

I'm using the jquery ajax library to pull some html content from a php file on my server. The above code works beautifully in IE and Firefox but, for the love of me, I cannot get it to work in Chrome. Is there something I'm missing?

Thanks, -Johnny

+2  A: 

This pattern may work better for an asynchronous request:

$(document).ready(function(){ 
  $("#home_tab").click(function(){ 
    $("#content").hide().load("php/media_body.php",function(){
      $(this).show("slow"); 
    });
  });
});
Alex Sexton
A: 

You could use

$.ajax({
 type: 'GET',
 url:'php/media_body.php', 
 data: "data=data",
 success: function(answer){eval(answer);} 
});

Safari and Chrome have client side security feature to prevent phishing. This way is more "secure".

And use an $('#whereToAppend').append() wrapping all the HTML of your file.

Siedrix