A way of disposing scripts files previously loaded with $.getScript()
题
Sorry about my English. I'm developing a chess interactive site. There is a lesson menu, when the user selects the lesson, it's loaded using $.getScript()
. Lesson file only has a variable lesson
that contains a "big" json object. When user selects another lesson, file is loaded and the new lesson
var overrides the previous one.
Ok, that works great. But, should I dispose the previous loaded file/s, and if I should, how I do that? What if the user navigates fifty lessons, will it slow down the process?
I took a look in firebug when the file is loaded and the <head>
, where supposedly $.getScript()
put the file, and it makes a 'yellow flash', but nothing visible is added.
I would want to know your thoughts about this. Thanks in advance.
没有正确的解决方案