What is the best way to set URL for <frame> in <frameset>
<p>I'm working with <strong>frameset</strong> and <strong>frame</strong> right now and I'm so confused about how to change frame URL. My customer they using either <strong>location</strong> or <strong>src</strong> wherever they like to set/change frame URL. Sometime <strong>location</strong> work, sometime <strong>src</strong> work so I'm going to find out what's going on.<br/>
I create 3 html files: <em>parent.html</em>, <em>left.html</em>, <em>right.html</em>. Here is the <em>parent.html</em> content</p>

<pre><code>&lt;frameset cols="*,*"&gt;
   &lt;frame id="left" src="left.html"&gt;
   &lt;frame id="right" src="right.html"&gt;
&lt;/frameset&gt;
</code></pre>

<p>Here is the <em>left.html</em> content</p>

<pre><code>&lt;head&gt;
    &lt;script&gt;
        function LocationThis() {
            window.frames['innerleft'].location = "http://prntscr.com";
        }
        function SrcThis() {
            window.frames['innerleft'].src = "http://prntscr.com";
        }
        function LocationOther() {
            window.parent.frames['right'].location = "http://prntscr.com";
        }
        function SrcOther() {
            window.parent.frames['right'].src = "http://prntscr.com";
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Left&lt;/h1&gt;
    &lt;button type="button" onclick="LocationThis();"&gt;Location this&lt;/button&gt;
    &lt;button type="button" onclick="SrcThis();"&gt;Src this&lt;/button&gt;
    &lt;button type="button" onclick="LocationOther();"&gt;Location other&lt;/button&gt;
    &lt;button type="button" onclick="SrcOther();"&gt;Src other&lt;/button&gt;
    &lt;hr/&gt;
    &lt;iframe id="innerleft" src="" /&gt;
&lt;/body&gt;
</code></pre>

<p>Only <strong>src</strong> work in this case. Then why <strong>location</strong> work sometime but <strong>src</strong> won't? Ok, now I change script like this</p>

<pre><code>//window.parent.frames['right'].location = "http://prntscr.com";
window.parent.frames[1].location = "http://prntscr.com";
</code></pre>

<p>Then <strong>location</strong> work fine. So <strong>frames['right'].src</strong> and <strong>frames[1].location</strong> then. But not all the case, sometime <strong>frames['right'].location</strong> work too. When I remove id and only using name for frame I must use <strong>location</strong></p>

<pre><code>&lt;frame name="right" src="right.html"&gt;
</code></pre>

<p>That's it. Oh and thanks to IE refuse to take src so I must checking like this</p>

<pre><code>try {
  window.parent.frames["id"].src = {url};
}
catch(er) {
  window.parent.frames["id"].location = {url};
}
</code></pre>

<p>Is there a neat solution for this whole things?</p>