webguync Posted March 6, 2013 Share Posted March 6, 2013 Is there a way to just hide an external link to a JS file specifically in IE7? I have some JQuery slide in effects working fine in every browser I tested in except IE7.(the functiality is completely screwy in that browser) It's not a necessary functionality to the page, so instead of racking my brain trying to fix in IE7, I was just hoping to hide/disable the link (IE7 only). That way nothing will happen in IE7 which is what I want. Quote Link to comment Share on other sites More sharing options...
Adam Posted March 6, 2013 Share Posted March 6, 2013 You could use IE conditionals to only include the script for IE8+, but I would build the logic into the JS, not the HTML. Using jQuery you have access to $.browser which makes it easy. In the document ready function or however your code is initialised, just add a return statement when the browser is IE7 (or less I'm guessing too?) $(function() { if ($.browser.msie && parseInt($.browser.version) <= 7) { return; } bindAllTheThings(); }); Quote Link to comment Share on other sites More sharing options...
Adam Posted March 6, 2013 Share Posted March 6, 2013 Alternatively if you were to only bindAllTheThings() when the browser is NOT IE7 or less, you could still bind certain functionality and not others: $(function() { var isIe7 = ($.browser.msie && parseInt($.browser.version) <= 7) ? true : false; if (!isIe7) { bindSomeThings(); } bindRestOfThings(); }); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.