loadCss('ie.css')
}else{
loadCss('other.css')
}
function loadCss(href){ var link =
document.createElement('link'); link.type = 'text/css';
link.rel = 'stylesheet'; link.href = href;
document.getElementsByTagName('head')[0].appendChild(link); }
On Nov 24, 12:24 am, Pawel_Iks <pawel.labed...@gmail.com> wrote:
> I would like to detect browser via javascript and by DOM load
> appropriate css file.
>
> On 21 Lis, 16:14, Calvin <calvinbus...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Instead of that, put this at the top of your head of your HTML file.
>
> > <!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
> > <!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
> > <!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
>
> > Now target your IE changes in the same resource files by a ie6, ie7,
> > ie8 class.
>
> > Now, you do not have to load separate resource files.
>
> > Calvin
>
> > On Nov 16, 6:34 am, Pawel_Iks <pawel.labed...@gmail.com> wrote:
>
> > > Hello!
>
> > > I would like to write script which works as follow:
>
> > > 1) it detect browser:
> > > 2) if browser=="ie" then it load "ie.css"
> > > 3) else, it load file "other.css"
>
> > > How to do it?
--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To post to this group, send email to javascript-information@googlegroups.com.
To unsubscribe from this group, send email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascript-information?hl=en.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.