public marks

PUBLIC MARKS from decembre with tags javascript & tag

05 August 2016 14:00

11 September 2015 09:15

jQuery - Does jQuery .remove() clear out loaded javascript when it is used to remove a script tag? - Stack Overflow

No. Once a script is loaded, the objects and functions it defines are kept in memory. Removing a script element does not remove the objects it defines. This is in contrast to CSS files, where removing the element does remove the styles it defines. That's because the new styles can easily be reflowed. Can you imagine how hard it would be to work out what a script tag created and how to remove it? EDIT: However, if you have a file that defines myFunction, then you add another script that redefines myFunction to something else, the new value will be kept. You can remove the old script tag if you want to keep the DOM clean, but that's all removing it does. EDIT2: The only real way to "clean up" functions that I can think of is to have a JS file that basically calls delete window.myFunction for every possible object and function your other script files may define. For obvious reasons, this is a really bad idea.

decembre's TAGS related to tag javascript

ajax +   animation +   api +   article +   bib +   bibliotheque +   blog +   bookmarklet +   browser +   carte +   checkbox +   code +   comment +   convert +   Cookie +   css +   cursor +   demo +   design +   dev +   development +   documentation +   dom +   editeur +   editor +   example +   exemple +   extension +   fichier +   firebug +   firefox +   flash +   flickr +   FlickrSurf+ +   fonction +   forum +   free +   function +   generator +   google +   google:maps +   greasemonkey +   guide +   hack +   howto +   htlm +   html +   image +   interface +   java +   jQuery +   json +   Korben +   library +   link +   list +   liste +   maps +   mobile +   ocr +   online +   opensource +   outil +   php +   player +   plugin +   programmation +   reference +   regex +   Responsive +   ressource +   scale +   script +   scroll +   scrollbar +   site +   size +   stackoverflow +   tag +   test +   text +   texte +   tips +   tool +   transform +   tuto +   tutorial +   tutoriel +   user +   userscript +   utilitaire +   video +   web +   web2.0 +   webdesign +   webdev +   xhtml +   xml +   xpi +   xul +