0

I want load a css or scss file of my rails 3.1 project with Jquery.browser detection.

In web page http://api.jquery.com/jQuery.browser/ I can see how set property css for example:

if ( $.browser.msie ) {
$("#div ul li").css( "display","inline" );
 } else {
$("#div ul li").css( "display","inline-table" );
 }

But I want can loading a CSS or SCSS FILe that I have in my project rails 3.1 depend if is browser opera, firefox, chrome, safari, ie...etc.

1 Answer 1

2

You can dynamically load different css files with:

$("<link/>", {
   rel: "stylesheet",
   type: "text/css",
   href: "/styles/yourcss.css"
}).appendTo("head");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.