<p>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.  </p>

<p>How can I make the dialog box show something like this:</p>

<pre><code>There was an error.  Go to this page to fix it.
wwww.TheWebPageToFix.com 
</code></pre>

<p>Thanks.</p>

[{'answer_id': 57204, 'author': 'Matthias Winkelmann', 'author_id': 4494, 'author_profile': 'https://Stackoverflow.com/users/4494', 'pm_score': 3, 'selected': False, 'text': "<p>You can't. Alert boxes don't support html. You should display the error as part of the page, it's nicer than JS alerts anyway.</p>\n"}, {'answer_id': 57213, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 2, 'selected': False, 'text': '<p>Or use window.open and put the <a href="http://qa.techinterviews.com/q/20060809080754AAs7gKM" rel="nofollow noreferrer">link there</a>.</p>\n'}, {'answer_id': 57214, 'author': 'Shog9', 'author_id': 811, 'author_profile': 'https://Stackoverflow.com/users/811', 'pm_score': 2, 'selected': False, 'text': '<p>Even if you could, <code>alert()</code> boxes are generally modal - so any page opened from one would have to open in a new window. Annoying! </p>\n'}, {'answer_id': 57215, 'author': 'DrFloyd5', 'author_id': 1736623, 'author_profile': 'https://Stackoverflow.com/users/1736623', 'pm_score': 2, 'selected': False, 'text': '<pre><code>alert("There was an error. Got to this page to fix it.\\nwww.TheWebPageToFix.com");\n</code></pre>\n\n<p>That\'s the best you can do from a JavaScript <code>alert()</code>. Your alternative option is to try and open a new tiny window that looks like a dialog. With IE you can open it modal.</p>\n'}, {'answer_id': 57233, 'author': 'jessegavin', 'author_id': 5651, 'author_profile': 'https://Stackoverflow.com/users/5651', 'pm_score': 3, 'selected': False, 'text': '<p>If you <strong><em>really</em></strong> wanted to, you could override the default behavior of the <code>alert()</code> function. Not saying you <strong><em>should</em></strong> do this.</p>\n\n<p>Here\'s an example that uses the YUI library, but you don\'t have to use YUI to do it: </p>\n\n<p><a href="http://htmlblog.net/yui-based-alert-box-replace-your-ugly-javascript-alert-box/" rel="nofollow noreferrer">YUI-based alert box - replace your ugly JavaScript alert box</a></p>\n'}, {'answer_id': 57236, 'author': 'Hafthor', 'author_id': 4489, 'author_profile': 'https://Stackoverflow.com/users/4489', 'pm_score': 3, 'selected': False, 'text': "<p>You can't - but here are some options:</p>\n\n<ul>\n<li><code>window.open()</code> - make your own dialog</li>\n<li>Use <code>prompt()</code> and instruct the user to copy the url</li>\n<li>Use JavaScript to just navigate them to the url directly (maybe after using <code>confirm()</code> to ask them)</li>\n<li>Include a <code>div</code> on your page with a [FIX IT] button and unhide it</li>\n<li>Use JavaScript to put a fix it URL into the user's clipboard (not recommended)</li>\n</ul>\n"}, {'answer_id': 57306, 'author': 'rpetrich', 'author_id': 4007, 'author_profile': 'https://Stackoverflow.com/users/4007', 'pm_score': 4, 'selected': True, 'text': '<p>You could try asking them if they wish to visit via window.prompt:</p>\n\n<pre><code>if(window.prompt(\'Do you wish to visit the following website?\',\'http://www.google.ca\'))\n  location.href=\'http://www.google.ca/\';\n</code></pre>\n\n<p>Also, Internet Explorer supports modal dialogs so you could try showing one of those:</p>\n\n<pre><code>if (window.showModalDialog)\n   window.showModalDialog("mypage.html","popup","dialogWidth:255px;dialogHeight:250px");\nelse\n   window.open("mypage.html","name","height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes");\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/57202', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/730/']