开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜