You can view the instances directly by loading JS files dynamically.
Example 1 reload the js File
The Code is as follows:
Function loadJs (file ){
Var head = $ ("head"). remove ("script [role = 'reload']");
$ (" "+""). Attr ({role: 'reload', src: file, type: 'text/javascript '}). appendTo (head );
}
Example 2 How to reload a javascript file (set an id for js) and encapsulate it into a method for your convenience:
The Code is as follows:
Function reloadAbleJSFn (id, newJS)
{
Var oldjs = null;
Var t = null;
Var oldjs = document. getElementById (id );
If (oldjs) oldjs. parentNode. removeChild (oldjs );
Var scriptObj = document. createElement ("script ");
ScriptObj. src = newJS;
ScriptObj. type = "text/javascript ";
ScriptObj. id = id;
Document. getElementsByTagName ("head") [0]. appendChild (scriptObj );
}
In Example 3, jquery directly uses getScript.
The Code is as follows: