I'm new to Javascript and hope that someone can help me!
I know that it is not possible to have two window.onload functions at the same time. I tried to figure out how to exactely rewrite the following piece of code so that both functions will work.
Code:<script type="text/javascript"> function liamEfas() { if (document.getElementById) { var alltags = document.all? document.all : document.getElementsByTagName("*"); for (i=0; i < alltags.length; i++) { if (alltags[i].className == "liamEfas") { var oldText = alltags[i].firstChild; var emailAddress = alltags[i].firstChild.nodeValue; var user = emailAddress.substring(0, emailAddress.indexOf("(")); var website = emailAddress.substring(emailAddress.indexOf(")")+1, emailAddress.length); var newText = user+"@"+website; var a = document.createElement("a"); a.href = "mailto:"+newText; var address = document.createTextNode(newText); a.appendChild(address); alltags[i].replaceChild(a,oldText); } } } } window.onload = liamEfas; var scroller = null; window.onload = function () { var el = document.getElementById("scroller"); scroller = new jsScroller(el, 480, 610); } </script>


Reply With Quote
Bookmarks