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 889675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:36:20+00:00 2026-05-15T13:36:20+00:00

I have some JavaScript code that is supposed to run on document.ready but I

  • 0

I have some JavaScript code that is supposed to run on document.ready but I keep getting an error in firebug saying the onLoad() method can’t be found.

Here is the code (which clearly shows that method there):

<script type="text/javascript">

    var tl;
    function onLoad1() {

        debugger;

        var eventSource = new Timeline.DefaultEventSource(0);

        // Example of changing the theme from the defaults
        // The default theme is defined in 
        // http://simile-widgets.googlecode.com/svn/timeline/tags/latest/src/webapp/api/scripts/themes.js
        var theme = Timeline.ClassicTheme.create();
        theme.event.bubble.width = 350;
        theme.event.bubble.height = 300;

        var d = Timeline.DateTime.parseGregorianDateTime("1900")
        var bandInfos = [
            Timeline.createBandInfo({
                width: "80%",
                intervalUnit: Timeline.DateTime.DECADE,
                intervalPixels: 200,
                eventSource: eventSource,
                date: d,
                theme: theme,
                layout: 'original'  // original, overview, detailed
            }),
            Timeline.createBandInfo({
                width: "20%",
                intervalUnit: Timeline.DateTime.CENTURY,
                intervalPixels: 200,
                eventSource: eventSource,
                date: d,
                theme: theme,
                layout: 'overview'  // original, overview, detailed
            })
        ];
        bandInfos[1].syncWith = 0;
        bandInfos[1].highlight = true;
        
        debugger;

        tl = Timeline.create(document.getElementById("tl"), bandInfos, Timeline.HORIZONTAL);
        // Adding the date to the url stops browser caching of data during testing or if
        // the data source is a dynamic query...
        var jsonFile = "<%= Url.Content("~/scripts/Views/Business/")%>test.js?"+ (new Date().getTime());

        tl.loadJSON(jsonFile), function(json, url) {
            eventSource.loadJSON(json, url);
        });
    }
    var resizeTimerID = null;
    function onResize() {
        if (resizeTimerID == null) {
            resizeTimerID = window.setTimeout(function() {
                resizeTimerID = null;
                tl.layout();
            }, 500);
        }
    }
</script>

<script type="text/javascript">

    $(document).ready(function() {
        debugger;
        onLoad1();
    });
    </script>

any idea why it can’t "find" that method.

EDIT

  • I put all of the JavaScript above (removed the image).
  • I renamed it onLoad1() but I still got the same issue.
  • I moved the first code below the function but I still get the same issue.
  • 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-05-15T13:36:21+00:00Added an answer on May 15, 2026 at 1:36 pm

    You have a syntax error here:

    tl.loadJSON(jsonFile), function(json, url) {
                        ^ the parentheses is prematurely closed
        eventSource.loadJSON(json, url); 
    });
     ^ syntax error, unexpected token
    

    You have to remove the closing parenthesis after the jsonFile argument:

    tl.loadJSON(jsonFile, function(json, url) {
        eventSource.loadJSON(json, url);
    });
    

    This SyntaxError was breaking the function declaration, what’s why onLoad was not defined.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have some javascript roll over code that works fine in firefox but when
I have written some javascript code that's supposed to put options into a select
I have some Javascript code that will programmatically register an COM interop assembly by
I have some JavaScript code that works in IE containing the following: myElement.innerText =
I have some javascript code that creates an img tag with a mouseover callback,
I have some Javascript code that creates 2 arrays: One for Product Category and
I have some javascript code that saves a cookie. However, if after saving the
I have some javascript and c# code inside one of my views that is
I have some code that dynamically creates a new button through JavaScript that when
I have a trivia page that is dynamically generated by some javascript code. It

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.