Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Dynamic CSS file using Javascript


Message #1 by meckeard2000@y... on Tue, 12 Nov 2002 16:05:52
Hi,

I need to dynamically include a .css file based on screen resolution.  But 
I cannot get the line to write to the browser:

if(screen.width<1280||screen.height<1024){
   //1028x768
   document.write("<LINK REL=stylesheet TYPE=text/css    
HREF=css/CalPopUp1024.css>");
}else{
   //800x680
   document.write("<LINK REL=stylesheet TYPE=text/css 
HREF=css/CalPopUp800.css>");
}

What am I doing wrong?

Thanks,
Mark

  Return to Index