JS Dynamic loading CSS Tutorials and javascrpt files This article is a free JS dynamic loading css and javascrpt file download package, if you are looking for dynamic loading JS or dynamic load CSS JS function here is very good ha, He can traverse javascrt or link to add again depending on user settings. */
Function $import (path,type,title) { var s,i if (type = "JS") { var ss = document.getElementsByTagName ("script"); for (i =0;i < ss.length i++) { if ( SS[I].SRC && ss[i].src.indexof (path)!=-1) return ss[i]; } s = document.createelement ("script"); s.type = "text/web Effects"; s.src =path; } Else if (type = = "css") { var ls = document.getelementsbytagname ("link"); for (i = 0; i < ls.length i++) { if (ls[i) . href && ls[i].href.indexof (path)!=-1) return ls[i]; } s = document.createelement ("link");br> s.rel = "Alternate stylesheet"; s.type = "Text/css"; s.href = path; s.title = title; s.disabled = false; } else return; var head = document.getElementsByTagName ("head") [0]; Head.appendchild (s); return s; }
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.