Background:I'm currently working on a landing page which will display the same on both desktop & mobile devices, which is what we "want" for now. However, we've created an alternate registration page for mobile devices. This page can be accessed by clicking on a specific button, which has a class on it that will determine if the user is on a mobile device or not. If they are not, the normal action will occur, such as a registration popup, built specifically for desktop users.

The problem is:I'm firstly having to use .remove to take away the class of pbx_ajax which operates the popup, so mobile users aren't affected by the popup and will continue onto the page we specially built for them. However, it seems my script is removing the class straight away, which prevents the popup from working for desktop users.Secondly, the script doesn't actually seem to work, it simply doesn't fire, which begs the question if i've cocked up my class bind.

Code is attached below, please if anyone has any advice, do let me know as i'm at my wits end.

Oh and i'm sure you'll notice, i'm polling for when the jQuery has loaded, as the library is located at the bottom of our site (its a rather large site).

Cheers for the assistance so far Parkin, appreciated. I've tried that fix of your's, however to no avail. I do agree with you though that DetectDevice was never even being called.I think it may also be an issue with my polling, as i don't think .bind is working. Sadly the jQuery lib can't be moved to the top, but i shouldn't really need to do that anyway.

Thinking about your 'problem' rather than simply 'an answer to your question', I have another approach in mind:

Using CSS you can display or hide one of two different links for the Registration (thus sending the user to a different registration page).Are you familiar with the "media" attribute in the CSS style tag? Are you comfortable with CSS?