in the function newAttribute you should replace
val = encodeForAttribute(val);
with this one:
if (!((attr == "src") || (attr == "href"))) val = encodeForAttribute(val);
Try html2dom with this string: '< iframe width="420" height="315" src="http://www.youtube.com/embed/anything" frameborder="0" >< /iframe >'
in the function newAttribute you should replace
val = encodeForAttribute(val);
with this one:
if (!((attr == "src") || (attr == "href"))) val = encodeForAttribute(val);
Try html2dom with this string: '< iframe width="420" height="315" src="http://www.youtube.com/embed/anything" frameborder="0" >< /iframe >'