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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:59:58+00:00 2026-06-10T05:59:58+00:00

I am customising a plugin that has array (if that is what is it)

  • 0

I am customising a plugin that has array (if that is what is it) that holds config items:

        var config = {
            width:  "100%",
            height: "100%",
            source: 'js/timeline/test.json',                
            css:    'js/timeline/compiled/css/timeline.css',    
            js:     'js/timeline/compiled/js/timeline-min.js'   
        }

What I want to do is take the source: data and replace it with a variable eg:

var mysource = 'path/to/source.json';

var config = {
                width:  "100%",
                height: "100%",
                source: mysource ,              
                css:    'js/timeline/compiled/css/timeline.css',    
                js:     'js/timeline/compiled/js/timeline-min.js'   
            }

But as it above it does not work. Can anyone point me in the right direction? Thanks

EDIT: Added full code as requested

$(function() {

    $.getJSON('http://www.mysite.com/json.php',

    function(data) {

        jsonObject = eval(data);
        var eventdata = jsonObject.tlall;

    });

}); //END ON LOAD

var config = {
    width: "100%",
    height: "100%",
    source: eventdata,
    //source: 'js/timeline/test.json',
    //start_at_end: true,   //OPTIONAL              
    //hash_bookmark: true,  //OPTIONAL              
    css: 'js/timeline/compiled/css/timeline.css',
    js: 'js/timeline/compiled/js/timeline-min.js'
}​
  • 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-10T05:59:59+00:00Added an answer on June 10, 2026 at 5:59 am

    I don’t know how exactly you plan to use config, but you certainly need it to be within the same scope in order to access eventdata. I would say get rid of that altogether, and just add it as a property of the object in the ajax callback (shown in code below).

    The difficulty here is that you are stuck waiting on the AJAX callback to fire before you can use config in your scripts; this is why ajax is designed to be used with callbacks executed after a particular event rather than linearly; I would advise you to use config only within that success callback, or add a check to see if getJSON has finished executing.

    $(function() {
    
        var config = {
            width: "100%",
            height: "100%",            
            css: 'js/timeline/compiled/css/timeline.css',
            js: 'js/timeline/compiled/js/timeline-min.js'
        };
    
        $.getJSON('http://www.mysite.com/json.php', function(data) {
            jsonObject = eval(data);
            config.source = jsonObject.tlall;
        });
    
    }); //END ON LOAD​​​​​​​​​​​​​​​​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on customizing a couple of open source projects in ways that are
I am working on customizing a closed source client application. It has a tree
How should I go about customising the AutoCompleteBox in Silverlight so that while typing
I'm customizing a plugin that uses css3's rgba throughout, I'm trying to figure out
Background I'm customising a tumblr theme (Source: hasaportfolio ), and I am trying to
I am customising the Wordpress plugin, JSON API . I want to output: Display
I'm customizing a image slider plugin, and would like to add a link, that
I'm customising the Group Headers on a Telerik RadGrid by injecting a LinkButton into
I have just meticulously followed MS instructions for customising a dynamic data page template
I was trying to customizing the UIBarButtonItem in Navigation Bar I found that there

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.