How to check whether a field has been declared or not?
<p>Here is my code:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
    &lt;title&gt;
        JS Test
    &lt;/title&gt;
        &lt;script type="text/javascript" src="jquery-1.4.2.min.js"&gt;&lt;/script&gt;
        &lt;script type="text/javascript"&gt;
        if(someObj != null || typeof someObj != 'undefined')
        {
            alert("Success.");
        }
        else
        {
            alert("Failed.");
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
</code></pre>

<p>
</p>

<p>Why it always return an error message-"someObj is not defined" to me?
I want to put the codes to foot of page to check whether the someObj has been declared or not.</p>
