How to identify device with hardware version using JQuery

How to identify device with hardware version using JQuery

How to identify the device with hardware version( eg:  iPad, iPad 2 WiFi , iPad 2 GSM,iPad 2 CDMA ) in  JQuery.

I already have solution for identifying device(eg: iPad, Iphone, etc). from UserAgent string.But I need both device name and  hardware version. Do you hav any ideaaa!!!,   please help meeee.....