Home > DeveloperSection > Forums > How to retrieve a specific div data using jQuery Ajax
Jayden Bell
Jayden Bell

Total Post:105

Points:739
Posted on    May-11-2013 2:17 AM

 AJAX AJAX 
Ratings:


 1 Reply(s)
 1282  View(s)
Rate this:
Hi Expert!

How to retrieve a specific div's  data using jQuery and Ajax

My Line of code as following

$(document).ready(function(){
  $("button").click(function(){
    $.ajax({url:"A.asp?mmid=1&umid=2" ,success:function(result){
      $("#adfrnd").html(result);
    }});
  });
});

I am trying to retrieve test div from A.asp page if I include

url:"A.asp?mmid=1&umid=2 #test"

It doeasn't work. Any suggestions?

Thanks in advance!


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    May-11-2013 9:53 AM

Hi!

You can use jQuery to wrap the resulting HTML and then find or similar from within that.

success: function(resultHtml) {
  $(resultHtml).find('.whatever-class').html() // then use this for whatever
}

Don't want to miss updates? Please click the below button!

Follow MindStick