Sunday, May 13, 2007

Blink blink

Finally the new Web 2.0 revolution has settled the standard-compliancy issue of the HTML <blink> tag! All you have to do is <span> your <blink> text and add a bit of <script>:

function makeXMLRequest() {
var browser = navigator.appName;
if (browser == "Microsoft Internet Explorer") {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
return new XMLHttpRequest();
}
}

var request = makeXMLRequest();

function sendXMLRequest(url) {
request.open('get', url);
request.onreadystatechange = handleResponse;
request.send(null);
}

function handleResponse() {
if (request.readyState == 4) {
var response = request.responseText;
document.getElementById('insert').innerHTML = response;
}
}
Then complete it all with an
<body onload="javascript:sendXMLRequest('blink-on.html')">
to you back-end server blinker applet, and you've got your blinking text!

No comments: