reading-time
reading-time copied to clipboard
avoid script execution if remote is a full HTML page
TODO : need improvement if script in body part of the page
Is this necessary? I haven't tested the plugin using a remote page that includes a script but I don't think it should matter, because the remoteTarget
will limit the content to the specified element. Can anyone confirm this?
The problem is that setTime($('<div>').html(data)
make all scripts tags of remote page data
beeing executed.
My use case is indicating reading time of "next article", so the remote page is a full HTML page embeding jQuery as the current one. Thus jQuery is overriden with a new instance and this broke some scripts that had a kept some reference to jQuery or some if it's methods.