Error: Attempt to run compile-and-go script on a cleared scope

前端 未结 10 2106
遇见更好的自我
遇见更好的自我 2020-12-02 16:45

Since upgrading to Firefox 4.0, I\'ve noticed that I\'m occasionally getting an error in the console stating:

attempt to run compile-and-go script on

10条回答
  •  既然无缘
    2020-12-02 16:59

    I've noticed that this error can happen if you write to the document with document.write after the document has completed loading (e.g. in a function called from JQuery's $(document).ready() method). When this happens, it seems that Firefox discards the old document and writes a new one. I don't know if this is new behavior or not. It seems that when you try to operate on the old document, e.g. with JQuery selectors, you get this error. For me, fixing the script in question to not call document.write after the document had loaded fixed the error.

提交回复
热议问题