That's an easy way. There are many others like AJAX google for that.
Thanks hollystyles, I tried the code and did not work. It seems that this code works when the script and the data are in the same page. I have the script in an html page different to the asp page.