2

In css when you want something to be ie only you can comment it out and assign ie. I have a jquery plugin that breaks in IE I don't want it to run in ie but I want it to run in all other browsers. How can I do this?

this worked!

jQuery(function() {
if(jQuery.browser.msie){}
else
{$('.div').corner("round 20px");};
});
2
  • 3
    Well, the best solution would be to check why your plugin is not working in IE... Commented May 21, 2010 at 4:42
  • it's a rounded corner plugin with stroke just icky in iE. Commented May 21, 2010 at 5:02

3 Answers 3

3

Try using conditional comments.

http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx

http://www.quirksmode.org/css/condcom.html

<!--[if !IE]>
Special instructions for non IE browsers
<![endif]-->
Sign up to request clarification or add additional context in comments.

Comments

1

Add some form of browser checking code that wraps your code in an if statement and only selectively runs it.

Psuedo code:

if( browse != "IE" )
{
     ... run code that breaks in IE ...
}

Or you could possibly wrap it in side of a try/catch block

2 Comments

this worked! thanks jQuery(function() { if(jQuery.browser.msie){} else {$('.div').corner("round 20px");}; });
@ThomasReggi, if this is the correct answer, please use the tick and mark this as the accepted answer :)
0

You can use jQuery.browser to check the browser and version. However, it is discouraged by the manual because it's bad practice to check only the browser name. It's much better to track down what feature in the browser is breaking the plugin and then check for that feature only with jQuery.support or similar.

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.