javascript - How to use req.responseText, in Ajax to return only the content inside a div of a page -


i using xmlhttp request in ajax, have problem. want use document.getelementbyid('partid').innerhtml=request.responsetext in way return content inside divcalled'cars' of page export.php. when use above return content of page export.php. there way make line of code return content inside div? trying use like:

document.getelementbyid('partid').innerhtml=request.responsetext.getelementbyid('cars'). , not function.

please,help me. have spend hours searching have not find this..please help.thanks in advance

when responsetext comes back, -- name suggests -- text.

before can access html, have turn html.

this typed off cuff, like:

var tempdiv = document.createelement("div"); tmpdiv.innerhtml = request.responsetext; var wanteddiv = tmpdiv.queryselector('[id="cars"]'); // might want empty out 'partid' first document.getelementbyid('partid').appendchild(wanteddiv); 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -