from jquery-2.1.3
tmp = new DOMParser(); xml = tmp.parseFromString( data, "text/xml" );
and jquery-3.5.1
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
What is the difference?
Know the answer? Post it. Somebody with the same question will find it here.



Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jan 29, 2021, 8:37 AM EST
This code in jQuery < 3.5 would produce two separate HTML elements
Since jQuery 3.5.0 the same code produces nested elements.