Re-insertion of <script> tags
- Insertion of a file's tag, thus executing the file's code.
- Removal of the file's tag.
- Insertion of the same file's tag.
Firebug does not seem to acknowledge and does not show the reinserted tag when the file's has alread开发者_如何学运维y been inserted before. It does upon new insertions, of course.
EDIT: Is this a problem of some kind? (the file still reloads apparently, but my tests only rely on logging some simple stuff)
Would simply evaling the code be sufficient for your purposes?
eval(script_element.innerText);
Update: Reappending the script seems to work.
Apparently, FireBug not showing the reinserted tag after removing it (probably LAB's fault) does not bring any side effects or problems which could need any atenttion.
Even the code gets rerun, so I guess problem solved.
精彩评论