There is no JavaScript in that code which could cause an error.
I'm guessing you are using serverside code to generate the code you posted? If so, please post that. What is the exact error text?
(We'll move this to the corresponding section if it turns out to be a serverside problem.)