API for Spotlight - Demo Page

Full featured, compact javascript API to spotlight. Library is clean and compact, built using solid OO javascript patterns. The API provides the following features:

  1. asynchronous, cross domain!, data connections library
  2. "manager" objects for data retrieval/rendering
  3. properly designed OO Javascript - rendering handled by renderer objects which can be overriden
  4. objects have usable default presentations and CSS controls 100% of the look
  5. in a nutshell, you get a DHTML news reader, a picture browser/slideshow and coming soon, video browsing
  6. can be used to build more complex spotlight widgets
  7. fully standalone, single js file, can be used with other/existing JS frameworks
  8. solid and compact (<14k - with comments, under 400 lines)

A demo of the library can be seen in action on my site. The library is available as a single JS file.

CODE EXAMPLE:

<script src="js/spotlight.js" type="text/javascript"></script>
...
...
<div id="topHeadlines">loading headlines...</div>
<script type="text/javascript">
    var topHeadlines = new spotlight.data.newsManager('topHeadlines', '**YOUR API KEY**', 'rssItems', 'rssItem', true, 150);
    topHeadlines.getData('us', 'hotStocksNews');
</script>
...

NOTE:

The asynchronous communication is fully encapsulated in the manager object, however, this all works by convention to reduce the overall amount of code required to get it running. In order for everything to work, one simple rule of thumb: ALL of the following items MUST be named the SAME thing:

  • JS object instance (variable name)
  • the id passed to the JS constructor
  • the DOM element id

Support

Average: 4 (4 votes)

CNA

Hey hows it going, I just wanted to say that I have been working on a  cna training program in wisconsin for the last couple of months.  I am creating a java based website at this cna training website.  I am trying to figure out what teh correct coding would be for me and my free cna training program.  I think I am going to give this a shot, I just wanted to check and see if there has been any good tweaks in the last few yearsthat you can suggest. Thanks