That would remove all script tags, but it sounds like that won't help.
Removing a script tag is just a memory optimization - it may free up the
memory that the script's source code took. It won't unexecute the JavaScript
code that has already been run, and it won't undo any DOM changes that the
code made.
There are several ways to delete the DOM nodes that COOLjsTree inserted, of
course - I wouldn't know which to suggest without seeing the page. The real
question may be whether the COOLjsTree code will freak out if you remove its
DOM nodes behind its back.
Or I may have misunderstood the problem...
-Mike
> $('script').remove();
>
> Should do the trick right? Assuming that you put that before
> the call to Mike's function (which probably adds script tags).
> > I'm seeking help in dynamically REMOVING an inline script
> > block within the head tags.
> >
> > My current application involves a case study editor, wherein
> > users add/delete/edit branches to a decision tree. The visual
> > representation of the tree is generated by COOLjsTree
> > (http://javascript.cooldev.com/) and is loaded into the page
> > as an inline script inside the head tags.
> >
> > I want to be able to dynamically delete the script block
> > containing the "old" tree, and replace it with a "new" block
> > immediately after a branch is added/deleted.
>
> > I'm using Michael Geary's code
> >
(http://www.nabble.com/Dynamically-loading-scripts-tf1913101.html#a5237431)
> > to load the new script block as needed. I'm stumped,
> > however, as to how I can dynamically delete the existing
> > ("old") script block. (In a previous version of the
> > application I used frames and the problem didn't exist - I
> > just refreshed the frame page in which the tree resided - but
> > I'm now using a frameless approach and that option isn't
> > available now)
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/