Grabbing this "loadcssfile" from http://www.javascriptkit.com/javatutors/loadjavascriptcss.shtml and added the check device.
This is the best I have and I may just be entirly confused! I want to change the CSS file depending on the device before the rest of the page loads.
function checkDevice(){
if(window.isiPad){
// do nothing
} else {
loadcssfile(desktop.css, css);
}
}
function loadcssfile(filename, filetype){
if (isset(filename)){ //if filename is set
var fileref=document.createElement('link');
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type","text/css");
fileref.setAttribute("src", filename);
}
}
Any ideas?