How to Add a Url to an Alert

link in alert boxes javascript

You can only display text in the alert function. If you want to put an url, you can do it by using jquery's dialog function. Here are some code examples: http://jqueryui.com/dialog/#default

How can I add a url to an alert?

You cannot add arbitrary interface to a UIAlertController. The title and message are not tappable. You cannot add further text. Instead, add another button (UIAlertAction) that directs them to the Web page. Either that, or use some other interface instead of a UIAlertController (for example, you can put up a presented view controller that looks like an alert).

How to add URL links to the alerts?

According to the documentation the description property accepts either a string or a ReactNode. Therefore you can try to define a ReactNode instead of a string that contains a Link component, e.g:

state = {
inValid: (
<div>This is a message because you haven't verified your email. If you haven't so, please click here to Verify Email <Link href="http://bing.com">Bing</Link>.</div>
)
};

How do I put a link to a webpage in a JScript Alert dialog box?

You could try asking them if they wish to visit via window.prompt:

if(window.prompt('Do you wish to visit the following website?','http://www.google.ca'))
location.href='http://www.google.ca/';

Also, Internet Explorer supports modal dialogs so you could try showing one of those:

if (window.showModalDialog)
window.showModalDialog("mypage.html","popup","dialogWidth:255px;dialogHeight:250px");
else
window.open("mypage.html","name","height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes");

Adding a redirection link to an AlertController button

You can add handler to your button that can call the method to open your playstore link:

buttons: [ {
cssClass: `cancel-button`,
text: `X`,
},
{
cssClass: `secure-hub`,
text: `Go To Play Store`, //<<<<<<< this button,
handler: () => {
this.yourMethodToOpenUrl()
}
}


Related Topics



Leave a reply



Submit