Script issue

I have a cookie opt in/ out script on several site and just tried to add it to a new one (the first time using 4.1). Although it works fine in preview, when it’s loaded ‘live’, it doesn’t work. I’ve narrowed the problem down to something weird. When I view the page source, the script (added thought a code widget) is being read as a developer comment (in green) not as script; so not executed. The code is identical on all the other sites. Any ideas?