tjrobinson tjrobinson - 1 month ago 11
Javascript Question

What causes the error "Can't execute code from a freed script"

I thought I'd found the solution a while ago (see my blog):


If you ever get the JavaScript (or should that be JScript) error "Can't execute code from a freed script" - try moving any meta tags in the head so that they're before your script tags.


...but based on one of the most recent blog comments, the fix I suggested may not work for everyone. I thought this would be a good one to open up to the StackOverflow community....

What causes the error "Can't execute code from a freed script" and what are the solutions/workarounds?

Answer

It sounds like you've hit a bug/problem in the way some tags are handled or that you have references to released objects on which you are trying to execute methods.

First I'd move any <meta> tags before any <script> tags as suggested here and here and numerous other places.

Then check to see if you have page/security issues discussed here.