Open csq2018 opened 4 years ago
What is the desired behavior? On the second click do you want to execute the callback without loading the script?
I have the same issue. multiple visits to a page causes repeated download/adding or same file by LoadJS. Is there a way to remove the previous file before re-adding them?
You can use the .isDefined()
method:
if (!loadjs.isDefined('foo')) {
loadjs('/path/to/foo.js', 'foo', function() { /* foo.js loaded */})
}
Every time I click to trigger the _confirm page, I insert confirm.js how to solve this situation?