Note that there are some explanatory texts on larger screens.

plurals
  1. POPrevent webpage dialog from spawning new browser window?
    text
    copied!<p>I have an open web page dialog. From there, what I'd like to do is when the user clicks on a link, refresh the contents of the dialog with modified query string parameters. The problem I am running into is that rather than refresh the same web page with new parameters, a new browser window pops up.</p> <p>Here is the page used to open the dialog:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script type="text/javascript"&gt; function ShowPopup() { var popWinFeatures = "dialogWidth: 800px;dialogHeight:600px;center:yes;status:no;scroll:no;resizable:yes;help:no"; window.showModalDialog("webPageDialog.html","PopUpWin",popWinFeatures); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="#" id="openWebPageDialog" onclick="ShowPopup()"&gt;Click For Modal&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and this is the code within the webpage dialog that attempts to refresh the webpage with changed query string parameters:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script src="scripts/jquery-1.6.4.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ var queryString = "?ab=123"; var newURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname; $('#testLink').attr('href', newURL+queryString); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href="#" onclick="" id="testLink" target="_self"&gt;Please Click Me&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I've also tried using <code>window.open</code> as well as setting <code>window.location</code>. And I've also tried setting <code>window.location.href</code> but the result was the same.</p> <p>the new browser window displays exactly what I expect. It's just not in the same window.</p> <p>Thoughts?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload