jQuery: load response Document into div
I get an asyc response from the server that contains an HTML that I would like to display:
$( document ).ready( function ()
{
var options =
{
success: showResponse,
error: errorHandl开发者_如何学编程er,
type: 'post'
};
// bind to the form's submit event
$('#captureForm').submit(function()
{
$(this).ajaxSubmit(options);
return false;
});
});
function showResponse(responseDoc, statusText)
{
$('#output').html( responseDoc );
}
Where #output is a div where I would like the response document to be injected. The above code does not do the trick.
Any suggestions will be greatly appreciated.
Thanks.
-Raj
it might be a problem with options, try moving them into the function.
精彩评论