0

I wanna remove/kill script that is previously being runed by one button. So, I have a button called Agree which run one script src:

 $.getScript("http://fileice.net/gateway/mygate.php?id=4465766c4278366467523838");

Now, how can I make other button called Disagree to kill this src (no idea how to call it on English) but simply to unload script.

Thank you.

dvlden
  • 2,192
  • 7
  • 35
  • 58
  • Check this related topic : http://stackoverflow.com/questions/4669065/unload-files-loaded-with-getscript – sdespont Aug 12 '12 at 15:03
  • You cannot unload results retrieved by getScript. Once the methods are added to the DOM, they are appended to their respective objects. Those objects would have to therein, each be iterated over and have their eventListeners/Handlers removed 1 by 1. At this point, you would have to use `$('element')[0].onEvent = null;`; however that method is a complete waste of time, as you should just conditionalize the data delivery and action of the getScript instead. Otherwise, use ajax to reload the elements affected and avoid that all together. – Ohgodwhy Aug 12 '12 at 15:04
  • what doing this script and how? can you call only http requests without execute script on client side? – Artur Gurgul Aug 12 '12 at 15:05
  • Hmmm I see... Well I've used "window.location = "index.php";" , because page refresh helps as script is loaded on button click. However I thought if theres better way to remove it. Seems like theres no :] – dvlden Aug 12 '12 at 15:07

0 Answers0