Author Topic: Javascript general  (Read 609 times)

oymyakon

  • Newbie
  • *
  • Posts: 2
Javascript general
« on: April 14, 2010, 07:32:46 AM »
Hi Guys,
i am a newbie to html and javscript. i have got the examples of the google needle and graph working etc.

How do i parse the data api feed into variables so that i can manipulate them as i cannot seem to get them to work.

i have tried this to no avail.

function checkTemp2()
{
var a
   $.getJSON("http://www.iobridge.com/api/feed/key=epV8EHUVJSxrb2pKHh&callback=?",
function (data) {
     a= (data.module.channels[1].AnalogInput);
   });
   return a
}
call me a thicko if you like but some help would be appreciated.

iobridge

  • Administrator
  • Hero Member
  • *****
  • Posts: 668
    • ioBridge Support
Re: Javascript general
« Reply #1 on: April 14, 2010, 07:52:31 AM »
The code looks fine. Are you including the jQuery library in the header? What does the rest of the code look like?

(If you want your code formatted on the forum, paste your code between the code tags - click the "#" on the toolbar.)



ioBridge Support
Community Team

oymyakon

  • Newbie
  • *
  • Posts: 2
Re: Javascript general
« Reply #2 on: April 14, 2010, 12:09:12 PM »
Thanks for the reply.

The var a prints on the webpage as undefined.

Paul.