Change JavaScript alert dialog title in iOS

VK.Dev picture VK.Dev · May 21, 2012 · Viewed 30.8k times · Source

Is it possible to change the JavaScript alert title in a UIWebview in iPhone?

Answer

twk picture twk · Jan 28, 2013

Basically you cannot change the title, but recently I have found a way to show an alert dialog with no title.

var iframe = document.createElement("IFRAME");
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
window.frames[0].window.alert('hello');
iframe.parentNode.removeChild(iframe);