git-svn-id: https://msi/svn/firstRepo/Management/trunk@8 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Created by Denis on 04/03/14.
|
||||
*/
|
||||
function addMetaFunction(name, content)
|
||||
{
|
||||
var meta=document.createElement('meta');
|
||||
meta.name=name;
|
||||
meta.content=content;
|
||||
document.getElementsByTagName('head')[0].appendChild(meta);
|
||||
}
|
||||
|
||||
function addLinkFunction(rel, href)
|
||||
{
|
||||
var link=document.createElement('link');
|
||||
link.rel=rel;
|
||||
link.href=href;
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
|
||||
function addLinkIconFunction(rel, href, size)
|
||||
{
|
||||
var link=document.createElement('link');
|
||||
link.rel=rel;
|
||||
link.setAttribute('sizes', size);
|
||||
link.href=href;
|
||||
document.getElementsByTagName('head')[0].appendChild(link);
|
||||
}
|
||||
|
||||
function addScriptFunction(scriptFile, version)
|
||||
{
|
||||
var head=document.getElementsByTagName('head')[0];
|
||||
var thisScript = head.getElementsByTagName('script')[1];
|
||||
var sc=document.createElement('script');
|
||||
sc.type='text/javascript';
|
||||
sc.async=true;
|
||||
sc.src= scriptFile
|
||||
if(version!="")
|
||||
sc.src += '?v' + version;
|
||||
thisScript.parentNode.insertBefore(sc,thisScript);
|
||||
}
|
||||
Reference in New Issue
Block a user