$.ajax({
type: "GET",
url: 'test.htm',
data: "id=" + 10,
error: function () { alert("failed") },
success: function (data) {
$('#container').html(data);
}
});
test.htm has some basic html and some script to generate some other html
$(document).ready(function () {
//generate some html and inject into dom
}
This works fine in IE and FF, but in chrome, the html in the page is returned, but the javascript in test.htm doesnt run so I dont get the complete page back
Any ideas?
The other thing I would like to know is, how can I pass query string data to test.htm that can be read by the client side javascript on the page? I tried using the data field in the ajax request which does actually add the querystring to the request (verified via http headers) but the page requested via ajax cant see them as the script runs in the current pages context and therefore sees the current pages querystring. Off course this doesnt wont at all in chrome as it doesnt run the client side script.
Any ideas?