Samir Adel
Samir Adel

Reputation: 2499

How to detect if i can use jquery on a browser or not

I currently using jquery in my website but when i try to open this website on ie 5.5 i get the error "$" is undefined so i am searching for a solution to detect if the browser support jquery or not before calling any jquery code

Upvotes: 0

Views: 183

Answers (2)

Craig
Craig

Reputation: 7076

I think you might have answered your own question. Check if $ is undefined. Thoguh as mentioned in the comments, IE 5.5 is not supported.

Edit

In case you needed the code to check if the alias for jQuery is undefined:

typeof $ == 'undefined'

Upvotes: 1

Nakul
Nakul

Reputation: 1600

if (typeof jQuery == 'undefined') {alert('no jquery');}

Upvotes: 4

Related Questions