Loading ...
Sorry, an error occurred while loading the content.

618json as js variable

Expand Messages
  • Mark Ireland
    Dec 7, 2006
    • 0 Attachment
      I have initialised a json string as a js variable and this simple test is
      working:

      a href="##"
      onclick="alert(typeof(jsonStations.DATA.MYVARIABLE[0].toString()))">myJSONVariable</a
      a href="##"
      onclick="alert(typeof(jsonStations.RECORDCOUNT))">myJSONObject.recordcount</a

      But this does not:

      function findNumChecked() {

      var num = 0;

      var chk = null;

      for (var j in jsonStations.RECORDCOUNT) {

      id = jsonStations.DATA.MYVARIABLE[j].toString();

      chk = document.getElementById(id);

      if (chk && chk.checked) num++;

      }

      return num;

      }

      What am I missing?

      Thanks

      _________________________________________________________________
      Advertisement: Fresh jobs daily. Stop waiting for the newspaper. Search Now!
      www.seek.com.au
      http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau&_t=757263760&_r=Hotmail_EndText_Dec06&_m=EXT
    • Show all 19 messages in this topic