title: I'm trying to get IP address value printed into 4 box's on some Html web page
body: <p>I have string with "." in the address trying  to use and Java script with String Tokenizer and slip each address into each box  </p>
  
  <p>Source C file which passes the values when requested by the html page (ipcfg/ipcfg_get)</p>
  
  <pre><code>/*
  * { "ipv4": {
  *  "addr": "192.168.1.1",
  *  "mask": "255.255.255.0",
  *  "gw": "192.168.1.1" }
  * }
  */
  cp = s;
  cp += sprintf(cp, "{ \"ipv4\": {");
  cp += sprintf(cp, "\"addr\": \"%d.%d.%d.%d\",",
          IP4_ADDR1(ipv4_addr), IP4_ADDR2(ipv4_addr),
          IP4_ADDR3(ipv4_addr), IP4_ADDR4(ipv4_addr));
  cp += sprintf(cp, "\"mask\": \"%d.%d.%d.%d\",",
          IP4_ADDR1(ipv4_mask), IP4_ADDR2(ipv4_mask),
          IP4_ADDR3(ipv4_mask), IP4_ADDR4(ipv4_mask));
  cp += sprintf(cp, "\"gw\": \"%d.%d.%d.%d\"",
          IP4_ADDR1(gw_addr), IP4_ADDR2(gw_addr),
          IP4_ADDR3(gw_addr), IP4_ADDR4(gw_addr));
  cp += sprintf(cp, "}}");   
  </code></pre>
  
  <p>HTML Program to get the values from the C file calling the function and no its not brackets or closing arguments.</p>
  
  <pre><code>&lt;script&gt;      
  function ipcfg_get () 
  {
          $.ajax({
              type: 'GET',
              url: '/ipcfg/ipcfg_get.cgi',
              dataType: 'json',
              success: function(data) {
                  var s = 'addr: ' + data.ipv4.addr;
                  s += ', mask: '+ data.ipv4.mask;
                  s += ', gw: ' + data.ipv4.gw;
              },
         });
  }
  
  $(function() {
      $('#btnreset').on('click', ipcfg_get);
  $('#btnapply').on('click', ipcfg_set);
  });
  &lt;/script&gt;
  </code></pre>