Между тем соорудил вот такое гавнище
load_ass=function(name,type){
var el,
head=D.getElementsByTagName('head')[0],
url=(location.protocol=="https:"?"https:":"http:")
+'//'+location.hostname+'/ass/'+name+'/'+type;
if (type=='js'){
el=D.createElement('script');
el.setAttribute('type','text/javascript');
el.setAttribute('src',url);
}
else if (type=='css'){
el=D.createElement('link');
el.setAttribute('rel','stylesheet');
el.setAttribute('type','text/css');
el.setAttribute('media','all');
el.setAttribute('href',url);
}
else
return;
head.appendChild(el);
}
Вопрос, за каким роботы так пишут:
location.protocol=="https:"?"https:":"http:"
если оно равно https, то равно https и можно просто воткнуть location.protocol, или в чем там фича?