timeglider/jquery_widget — Issue #38: Allow loading JSON from an existing object/string
Author: capeterson
Created: 2012-02-21 21:46:40+00:00
State: open

Background: I'm looking at using timeglider in an open-source project that runs on top of salesforce.com, which means I'm stuck and/or blessed with following the way their platform runs. While on salesforce it's possible to have a "normal" ajax URL that returns a JSON string, it has extra overhead performance-wise and is a sperate "page" that has to have access granted for it, making this approach sub-optimal.

WIth that said, they have a very nice system that allows you to annotate a method and have it directly callable from within a page, e.g. the javascript String someJSON = myClass.getJSON(); would handle all the work of making the "AJAX" request, escaping it, etc. for me. However, I can't use this approach with timeglider as it required a URL to fetch data from, and doesn't seem to be able to directly accept a string or object to use as a data source. If this were possible it would make my life much easier, and in one use case would prevent the same data from being generated twice on the server side.