Improved method for outputting javascript data with the page.