JavaScript inline variables used by external JavaScript file? (Variable Scope issue)
<p>I have the following code:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    var ops = {
        slideshow: {
            slices: 20,
            boxCols: 11,
            boxRows: 6,
            animSpeed: 750,
            pauseTime: 6000
        },
        tweets: {
            username: 'stigmahost',
            count: 6,
            refresh_interval: 120,
            auto_join_text_default: 'I said,',
            auto_join_text_ed: "I",
            auto_join_text_ing: "I am",
            auto_join_text_reply: "I replied to",
            auto_join_text_url: "I was looking at",
            just_now: 'Now',
            X_seconds_ago: '{x} seconds ago',
            about_a_minute_ago: 'About a minute ago',
            about_X_minutes_ago: 'About {x} minutes ago',
            about_an_hour_ago: 'About an hour ago',
            about_X_hours_ago: 'About {x} hours ago',
            about_a_day_ago: 'About a day ago',
            about_X_days_ago: 'About {x} ημέρες ago'
        },
        map:
        {
            latitude: 37.966667,
            longitude: 23.716667,
            zoom: 8
        }
    }
&lt;/script&gt;
</code></pre>

<p>and <strong>immediately</strong> after that code I have that code:</p>

<pre><code>&lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=MyKey&amp;sensor=true"&gt; &lt;/script&gt;
&lt;script type="text/javascript" src="js/js.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/jquery.tweet.js"&gt;&lt;/script&gt;
</code></pre>

<p>Then from within the <strong>js.js</strong> file I try to use the <strong>ops</strong> variable but with no any luck. Do you have any idea why I cannot use the variable <strong>ops</strong> into the <strong>js.js</strong>.</p>

<p>Into js file I have use that code in order to determine the type of the ops variable:</p>

<pre><code>console.dir(ops);
</code></pre>

<p>and in my Console I get the <strong>undefined</strong> result.</p>

<p>Have I did anything wrong ?</p>

<hr>

<p>I did some progress. The js.js file is like that:</p>

<pre><code>jQuery(document).ready(
    function()
    {
        console.dir(typeof ops);
        ...
        File code here
        ...
    }
);
</code></pre>

<p>The above code return in my console "undefined"</p>

<p>Now I have try that:</p>

<pre><code>console.dir(typeof ops);

jQuery(document).ready(
    function()
    {
        console.dir(typeof ops);
        ...
        File code here
        ...
    }
);
</code></pre>

<p>and return in my Console, "Object" for the first try and "undefined" for the second typeof.</p>

<p>Can that help ?</p>
