I am doing some logic to a string and everything workes fine in Firefox. Found error in IE but confused to fix it.
var txt=[], regg=/<\/?[^>]+>/gi, ost=str.replace(regg,'').substr(0,l), g=j=0;
var match = null;
while(match = regg.exec( str )){
var f = (regg.lastIndex-match.index);
txt.push([match[0], match.index, regg.lastIndex, f]);
}
In the above code if I call regg.exec( str ) before while then then working in IE. But don’t understand why to call.
Also observed that ost=str.replace(regg,'').substr(0,l) is not accepting for IE.
Guys, Please help.
Thanks in advance.
In this line
the ‘l’ char is not a number, but a text character. Replace it with a number you need.
Also to see javascript errors:
In FF install and open FireBug
In IE go to: Tools-> Internet Options -> Advanced tab -> Browsing section, and uncheck the “Disable script debugging (Internet Explorer)”