This is a very simple question that I just cannot find in order to find a good answer.
$.get('/myurl.html', function(response){ console.log(response); //works! console.log( $(response).find('#element').text() ); //null :( }, 'html');
I am just trying to execute my html answer. So far, the only thing I can think about is a regular expression inside body tags and use it as a string to create a traversable jQuery object. But it just seems stupid. Anyone have to point out the correct way to do this?
Maybe its my html?
<html> <head> <title>Center</title> </head> <body> </body> </html>
This also works great, but doesn't suit my needs:
$ ('# myelem'). load ('/myurl.html #element');
source share