Fix jQuery.parseHTML does not recognize document

Fix #2307.
Merge pull request #2308 from lijunle/jQuery-parseHTML

Fix jQuery.parseHTML does not recognize document