define([], function(){ function Dom(){}; Dom.prototype = { parser: null, serializer: null, html: "" + "AMP - AMP Login" + "", init: function() { this.parser = new DOMParser(); this.serializer = new XMLSerializer(); this.doc = this.parser.parseFromString(this.html, "text/html"); }, acceptSource: function(string) { var body = this.doc.querySelectorAll("body")[0]; body.innerHTML = string; }, getSourceAsString: function() { return this.serializer.serializeToString(this.doc); }, }; return Dom; });