- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspawn.js
More file actions
Latest commit
17 lines (15 loc) · 386 Bytes
/
Copy pathspawn.js
File metadata and controls
17 lines (15 loc) · 386 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
functionspawn(path){
varscript=document.currentScript;
varelement=document.createElement('div');
varattributes=$(script).prop('attributes');
$(script).before($(element).load(path,
function(){
varroot=$(element).children().first();
$.each(attributes,function(){
root.attr(this.name,this.value);
});
root.unwrap();
})
);
$(script).remove();
};