lundi 6 avril 2015

css added from remote node.js but not apply on html page

The application on which m working I am calling CSS file from remote server dynamically and remote server side we are using node.js where file loads but not apply CSS on the page.


When I try to add the path other than node.js server path it works properly and when I add some CSS from javascript this also works.


I tried following option




  1. loadCSS = function(href) { var href = "http://ift.tt/1IEIHsJ"; var cssLink = $(""); $("head").append(cssLink); }; // not working




  2. $('head').append('http://ift.tt/1IEIHsJ" type="text/css" />') // (remote side node.js) not working




  3. $('head').append('http://ift.tt/1xZSdWV" type="text/css" />') // working (without node js)




  4. function loadjscssfile(filename) { var fileref=document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css") fileref.setAttribute("href", "http://ift.tt/1IEIHsJ") document.getElementsByTagName("head")[0].appendChild(fileref); } // not working




Plz help me out for this.


Aucun commentaire:

Enregistrer un commentaire