jQuery selectiors in AJAX response

jQuery selectiors in AJAX response

 Hi all,


The result of an AJAX search is HTML code. How could I use a jQuery selector in the result, or create a jQuery object from it?


   
  1.  doc = window.document
  2. jQuery.ajax({
  3.   type: "POST",
  4.   dataType: "html",
  5.   url: "foobar",
  6.   cache: false,
  7.   error: function (XMLHttpRequest, textStatus, errorThrown) {
  8.     alert("Error occured textStatus=" + textStatus + " errorThrown=" + errorThrown);
  9.   },
  10.   success: function(data) {
  11.     jQuery('body', doc).append(jQuery('#something', data).html());
  12.   }
  13. });
Thanks! :)