Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: SV: Dynamic CSS file using Javascript


Message #1 by "Robert Nyman" <robert.nyman@c...> on Tue, 12 Nov 2002 18:03:35 +0100
Your example works for me, can we see the whole enchilada?
Joe
----- Original Message ----- 
From: "Mark Eckeard" <meckeard2000@y...>
To: "JavaScript HowTo" <javascript_howto@p...>
Sent: Tuesday, November 12, 2002 5:55 PM
Subject: [javascript_howto] Re: SV: Dynamic CSS file using Javascript


> Robert,
>
> I have tried in different locations, including the
> HEAD.
>
> After the code runs (an ASP page), I can view -->
> source, but I don't see the line being written out.
> All I see is the code below, almost like it ignores
> it.
>
> Thanks,
> Mark
> --- Robert Nyman <robert.nyman@c...> wrote:
> > The code, at a first glance, seems ok.
> > Where do you put this code in your document?
> >
> > Is it placed accordingly in the HEAD section?
> >
> >
> > /Robert
> >
> >
> > -----Ursprungligt meddelande-----
> > Från: meckeard2000@y...
> > [mailto:meckeard2000@y...]
> > Skickat: den 12 november 2002 16:06
> > Till: JavaScript HowTo
> > Ämne: [javascript_howto] Dynamic CSS file using
> > Javascript
> >
> >
> > 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
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
>
>

  Return to Index