Ravi Kotecha

Javascript Page Reload with Cross Browser Compatibility

<div class="codehilite"><pre><span></span><code><span class="kd">var</span><span class="w"> </span><span class="nx">meta</span><span class="p">;</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="p">(</span><span class="nx">meta</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;meta&#39;</span><span class="p">))</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="nx">meta</span><span class="p">.</span><span class="nx">httpEquiv</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">&#39;refresh&#39;</span><span class="p">;</span><span class="w"></span>
<span class="nx">meta</span><span class="p">.</span><span class="nx">content</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">&#39;1;&#39;</span><span class="w"></span>
<span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;head&#39;</span><span class="p">).</span><span class="nx">item</span><span class="p">(</span><span class="mf">0</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">meta</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>