dimanche 23 avril 2017

If/else jQuery function

How would I show "no IPv6" or "no IPv4" if no IPv6 or IPv4 Address was available with an if/else statement for the following jQuery functions?

  $(function() {
    $.getJSON("http://ift.tt/2p5wMlm",
      function(json) {
        document.write("Your IPv6 Address: ", json.address);
      }
    );
  });

  $(function() {
    $.getJSON("http://ift.tt/2ohN8tW",
      function(json) {
        document.write("Your IPv4 Address: ", json.address);
      }
    );
  });

I'd also like to know the best way to separate or line break the two functions within an html or php file.

Aucun commentaire:

Enregistrer un commentaire