tags:

views:

41

answers:

1

i have the following code;

$("#testbtn").live("click", function(){
$("#targetdiv").load("http://localhost/test/test.php");
});

but it is not working in ie but working fine in chrome firefox safari etc...

+1  A: 

If it is not working in IE, but it is in standards compliant browsers, it may just be a simple (or not so simple) CSS layout situation.

In a callback to the load method, do an alert to verify that the data was received.

$("#testbtn").live("click", function(){
    $("#targetdiv").load("http://localhost/test/test.php", function(data){alert(data);});
});
patrick dw
@patrick - I think you mean the data passed to `$.loads`'s callback instead of the click handler.
karim79
@karim79 - Absolutely! ;o) Thanks, I'll correct.
patrick dw
yes it is alerting the data recieved that is same in the test.php but it is not showing it in #targetdiv
Web Worm
@testkhan - If it is not showing up only in IE, then it is likely an issue with your CSS layout. If you put some static content inside `#targetdiv` instead of using `load()`, does it appear? If not, then you know that the issue has nothing to do with `load()`.
patrick dw
@testkhan - ...or if static text does appear, then a CSS issue may exist solely in the loaded HTML.
patrick dw