function sc_HTMLParser(aHTMLString){
var parseDOM = content.document.createElement('div');
parseDOM.appendChild(Components.classes['@mozilla.org/feed-unescapehtml;1']
.getService(Components.interfaces.nsIScriptableUnescapeHTML)
.parseFragment(aHTMLString, false, null, parseDOM));
return parseDOM;
}
becomes
this.HTMLParser = function(aHTMLString){
var parseDOM = content.document.createElement('div');
parseDOM.appendChild(Components.classes['@mozilla.org/feed-unescapehtml;1']
.getService(Components.interfaces.nsIScriptableUnescapeHTML)
.parseFragment(aHTMLString, false, null, parseDOM));
return parseDOM;
}
and
searchcontents = req.responseText;
parsedHTML = sc_HTMLParser(searchcontents);
sitefound = sc_sitefound(compareuris, parsedHTML);
becomes
searchcontents = req.responseText;
alert(searchcontents);
parsedHTML = this.HTMLParser(searchcontents);
alert(parsedHTML);
sitefound = this.sitefound(compareuris, parsedHTML);
The modular code alerts the search contents, but doesn't alert the parsedHTML. Why? How to solve?
UPDATED:
j0rd4n, it's:
function SiteCompare() {
this.finishSiteCompare = function(downloaduris, compareuris, tryinguri) {
// code
searchcontents = req.responseText;
alert(searchcontents);
parsedHTML = this.HTMLParser(searchcontents);
alert(parsedHTML);
sitefound = this.sitefound(compareuris, parsedHTML);
// code
}
this.HTMLParser = function(aHTMLString) {
//code
}
}
The call is not even being made.
UPDATE:
the Error Console says this.HTMLParser is not a function