You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I'd suggest:

    var json;
    try { json = JSON.parse(data); } catch (e) {}
    if (json && "Hostname" in json) {
      ...
    } else {
      // no data
    }
    
About

Avatar for Gordon @Gordon started