UIWebview Action Alert

UIWebview Action Alert

If there is an <a href></a> tag in the html that is being loaded in an UIWebView, then touching that link for few seconds would trigger an alert showing ‘Action’ or the alternate text provided for the link.

If we need to disable it, then we need to set

document.documentElement.style.webkitTouchCallout=”none”;

This can be called in the onload event of the html <body> tag which is being loaded in UIWebview. Put this piece of Javascript before the <body> tag

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Hide Action Alert In UIWebView</title>

<script type="text/javascript">
function OnLoad()
{
   document.documentElement.style.webkitTouchCallout = "none";
}
</script>
</head>
<body onload="OnLoad()"/>
</body>
</html>
About Me: Anish Kumar:
Mac OS X software development is my bread winner with over 6 years of experience. Expertise in Color Management, TWAIN Scanner drivers on Mac OS X, Photoshop Filter and Import Plugin development on Mac OS X, iPhone. As an hobby I love to work on PHP, Flex, AIR, Photoshop. Check the 'About' page for more.