First, it really helps to say what technology you are using. This could be Java, C#, Javascript, you name it. It could be running on the server or in the client. Actually I seem to recognize the "async" and "onload" properties from the MSXML product, and I also recognize the tendency of Microsoft users to assume that everyone else is a Microsoft user - so perhaps that gives me a clue.
Secondly, don't tell us "it doesn't work". Tell us what it actually does and what you hoped it might do. We can't extrapolate your requirements simply by looking at incorrect code.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference