Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change JavaScript alert dialog title in iOS

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

like image 920
VK.Dev Avatar asked May 21 '12 07:05

VK.Dev


People also ask

Can we change the title of alert in JavaScript?

It's not possible to edit a JavaScript alert box title due to security issues. Still, to edit an alert box to work it all web browsers, use custom JavaScript Modal Dialogs or jQuery plugins.

How do you alert in JavaScript?

One useful function that's native to JavaScript is the alert() function. This function will display text in a dialog box that pops up on the screen. Before this function can work, we must first call the showAlert() function. JavaScript functions are called in response to events.

What is alert dialog box in HTML?

An alert dialog box is mostly used to give a warning message to the users. For example, if one input field requires to enter some text but the user does not provide any input, then as a part of validation, you can use an alert box to give a warning message.


1 Answers

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); 
like image 54
twk Avatar answered Sep 25 '22 02:09

twk