If var condition to redirect to url
===

I am trying to use the jQuery version of the mobile redirect script provided here - http://detectmobilebrowsers.com/

The simple instruction says, "jQuery.browser.mobile will be true if the browser is a mobile device"

I am trting to create a if condition to redirect the page but I am a newbie. Help would be appreciated.

    var mobile = "jQuery.browser.mobile";
    var url = "http//domain.com/mobile";
    
    $(document).ready(function() {
        if (mobile = true) {
            $(location).attr('http://domain.com/mobile',url);
        }
    });

