Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:42:59+00:00 2026-06-04T13:42:59+00:00

I have the following code: <script type=text/javascript> var ops = { slideshow: { slices:

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:43:00+00:00Added an answer on June 4, 2026 at 1:43 pm
    $.getScript("js.js", function() {
        //declare ops-variable in here and use it
    });
    

    Without jquery:

    var Loader = function () {
    
    }
    Loader.prototype = {
    require: function (scripts, callback) {
        this.loadCount      = 0;
        this.totalRequired  = scripts.length;
        this.callback       = callback;
    
        for (var i = 0; i < scripts.length; i++) {
            this.writeScript(scripts[i]);
        }
    },
    loaded: function (evt) {
        this.loadCount++;
    
        if (this.loadCount == this.totalRequired && typeof this.callback == 'function') this.callback.call();
    },
    writeScript: function (src) {
        var self = this;
        var s = document.createElement('script');
        s.type = "text/javascript";
        s.async = true;
        s.src = src;
        s.addEventListener('load', function (e) { self.loaded(e); }, false);
        var head = document.getElementsByTagName('head')[0];
        head.appendChild(s);
    }
    }
    
     var l = new Loader();
    l.require([
    "js.js"
    function() {
        // do same stuff in this callback
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following code <div class=framepage> <header> <script type=text/javascript> function getBaseUrl() { return
So I have the following JavaScript code: <script type=text/javascript> function clearRadioButtons() { document.getElementById(radiobutton1).checked=; //etc
I have the following code: JS <script type=text/javascript> $(function(){ $('#fgotpwfield').hide(); $('#login_submit').click(function() { $('#form_result').fadeOut('fast'); $('#myccrxlogin
I have the following file file: <html> <head> <title></title> <script type=text/javascript src=/Prototype.js></script> <script type=text/javascript>
I have written the following in a JavaScript method : <html> ... <script type=text/javascript
I have the following code: <fx:Script> <![CDATA[ import shared.GlobalsManager; import app.Globals; protected var globals:Globals=GlobalsManager.getGlobals();
I have the following code that works fine in IE: <HTML> <BODY> <script language=JavaScript>
<html> <body> <script src=raphael.js type=text/javascript></script> <script>// Each of the following examples create a canvas
I have the following Javascript code: function checkIfValid(){ var form = document.createuserform; if(form.fName.value ==

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.