Widget generator code copied into aspx page - in IE9 give Javascript error - how to get it working?


Copy and pasted html+javascript code from Widget generator for aspx page.
When I run it in IE9, it gives a javascript error: Unable to get value of the property ‘replace’: …
How do i fix this so the javascript error message doesn’t pop up in IE9?