I am working on automatic phone number highlight application in android. I have included javascript file in my android browser and used following code for rewriting the html document.
var regex = /\d{10}/g;
var text1234 = $("body:first").html();
text1234 = text1234.replace(regex, "<a href='tel:$&'>$&</a>");
$("body:first").html(text1234);
This code is working on some webpage which contains no javascript file and browser crashes with others. While commenting "$("body:first").html(text1234);" this line just page load without changes. How to solve this problem.