Coding Tips (JavaScript/CSS/VBA/Win32)

Useful code snippets, tips and some Windows applications
Use ProxyChanger 2.2
to change IE proxy settings

Write messages on the page instead of using alert boxes

This functionality is very useful for javascript debugging purposes.
The required steps:
Create an empty div tag with an id
Example: <div id='msg' style='background:#FFC1C1'></div>

Use the following function instead of an alert:

function appendMsg( text){
var oDiv = document.getElementById("msg");

var msg = oDiv.innerHTML;

var br = (msg.length)?"<br>":"";

oDiv.innerHTML = msg + br + text;

}

In the first line, we get the id of the div that will hold the messages.
In the second line, we get the contents of the div. If the div contains messages already, we add a break tag and append the passed text.

I created a DOM version of the function that does not require you to create a div tag first.