its.a();

A friendlier alert with type detection.

Advantages its.a(); has over alert();

Advantages its.a(); has over console.log();


String:

  // -- Number String Test -- //
  var numberString = '1';
  its.a(numberString);
  

Number:

  // -- Number Test -- //
  var number = 1;
  its.a(number);
  

Boolean:

  // -- Booleon Test -- //
  var trueTest = true;
  its.a(trueTest);
  

Not a Boolean:

  var itsNotABooleon = 'true';
  its.a(itsNotABooleon);
  

Date

  // -- Date Test -- //
  var date = new Date();
  its.a(date);
  

Array

  // -- Array Type Test -- //
  var newArray = [ 1, 'hello', true ];
  its.a(newArray);
  

arrayWithObjects

  // -- Array with objects -- //
  var arrayWithObjects = [{
     "city": "Dallas",
     "state": "TX",
     "zip": 75201,
     "price": 162500
  },{
     "city": "New York",
     "state": "NY",
     "zip": 00010,
     "price": 962500
  }];
  its.a(arrayWithObjects);
  

Simple Object

  // -- Simple Object Test -- //
  var ObjectTest =
      {
          "key1": {
            "1":"The value of key1 in ObjectTest"},
          "key2": "The value of key2 in ObjectTest",
          "key3": "The value of key3 in ObjectTest"
      };
  its.a(ObjectTest);
  

More Complex Object

  // -- Object containaining a variety of properties types -- //
  var multiStructuredObject = { 
    foo: "bar",
    foo2: "foo2",
    arr: [1,2,3],
    subo: {
      foo2: "bar2",
      anotherfoo: "bar3",
      newArr:[1,2,3],
      subsubo: {
        foo3: "bar3"
      }
    }
  };
  its.a(multiStructuredObject);
  

Single Element

  // --  Element Test -- //
  its.a(document.body);
  

HTML Collection

  // --  Element Test -- //
  its.a(document.getElementsByTagName('li'));
  

HTML Nodelist

  // --  Element Test -- //
  its.a(document.querySelectoryAll('li'));
  

Remove all messages

  its.clearAll();