window.message()

Simple window.alert() replacement both as jQuery plugin and Vanilla JavaScript implementation.
console.log and window.alert alternative to display messages in case you want them to be seen within the document.


Plain JavaScript implementation :

  1. Include the window-message.js file within your source code.
    <script type="text/javascript" src="window-message.js"></script>
  2. Send messages to the window simply by calling the function:
    message('your message goes here');

Usage Examples :

  1. 'Hello World' Message

    message('Hello World!');


  2. Arbitrary Message

    var val = document.querySelector('#input-test-02').value;
        val = (val == '') ? 'no input message!!' : val;
        message(val);

  3. Multiple Messaging

    var n = [];
        for ( var i in navigator ) { n.push(i +' : '+ navigator[i]); }
        function nn(i) {
            message(n[i]);
            if ( i < n.length-1 ) { setTimeout(function(){ nn(i+1) }, 200); }
        }
        nn(0);