you tryin' to tell me you don't know what's wrong?
nigga, you got like 50 else if's in there. clean that shit up.
throw it on a jsfiddle and I'll help
Name:
Anonymous2014-02-25 22:13
>>7 throw it on a jsfiddle and I'll help
Please don't, you'd be setting a bad example.
Name:
Anonymous2014-02-26 15:51
>>7
the else's are there because it shouldn't need to keep checking the url if it's already matched one.
Name:
Anonymous2014-02-26 15:54
>>7
Anyway, the modifyurl() function does work. Cleaning links on the page doesn't:
// Clean links on the page
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
links[i].href = modifyurl(links[i].href);
}