ok, i'm kinda getting this, you want to pull in some javascript based on the user agent (like IE) and re-use the contents as a variable on the page.
the only thing i can think of is using forms and capture that content as a hidden value
but i don't think this will accomplish what you are trying to do
did you want the contents to be used for javascript