如何在“ JScript警报”对话框中放置指向网页的链接? [英] How do I put a link to a webpage in a JScript Alert dialog box?

查看:56
本文介绍了如何在“ JScript警报”对话框中放置指向网页的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在警报对话框中放置指向网页的链接,以便我可以更详细地说明如何解决导致创建对话框的错误。

I would like to put a link to a webpage in an alert dialog box so that I can give a more detailed description of how to fix the error that makes the dialog box get created.

如何使对话框显示如下内容:

How can I make the dialog box show something like this:

There was an error.  Go to this page to fix it.
wwww.TheWebPageToFix.com 

谢谢。

推荐答案

您可以尝试询问他们是否希望通过window.prompt来访问他们。

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/';

此外,Internet Explorer支持模式对话框,因此您可以尝试显示以下对话框之一:

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");

这篇关于如何在“ JScript警报”对话框中放置指向网页的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆