How to read a file using jquery and get content of head and body?
问题 I'm trying to read a html file and get the content of head and body tags using jquery. But no luck for me. This is the code i'm using. It worked for me to find the content of a id or a class. But not with head and body tags? Hope you guys can help me out soon. Thanks. $.get(file, function(response) { alert(response); alert($(response).filter('body').html()); //is null alert($(response).filter('head').html()); //is null }); 回答1: I was using a hand-made filtering function. Basically it converts