I have the following code:
<script type="text/javascript">
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
}
}
</script>
and immediately after that code I have that code:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=MyKey&sensor=true"> </script>
<script type="text/javascript" src="js/js.js"></script>
<script type="text/javascript" src="js/jquery.tweet.js"></script>
Then from within the js.js file I try to use the ops variable but with no any luck. Do you have any idea why I cannot use the variable ops into the js.js.
Into js file I have use that code in order to determine the type of the ops variable:
console.dir(ops);
and in my Console I get the undefined result.
Have I did anything wrong ?
I did some progress. The js.js file is like that:
jQuery(document).ready(
function()
{
console.dir(typeof ops);
...
File code here
...
}
);
The above code return in my console "undefined"
Now I have try that:
console.dir(typeof ops);
jQuery(document).ready(
function()
{
console.dir(typeof ops);
...
File code here
...
}
);
and return in my Console, "Object" for the first try and "undefined" for the second typeof.
Can that help ?