Ajax doesn’t work on mobile unless using www. prefix

I have a web page that uses Ajax and it works great on the desktop using domain.com or www.domain.com.
It also works great on mobile, as long as I use the www.domain.com URL.

When accessing the naked domain from mobile everything works except the “ajax button”. I added a alert() in the onclick event and it works, but won’t go on to call the Ajax function (doesn’t even get to the function – I added an alert() in there, too, but it never fires).

I am using IIS6 and have multiple identities defined for the website (for domain.com as well as www.domain.com). They both work, but the function that calls Ajax only works (on mobile) if the www is in front.

I am retrieving a local file with the Ajax call.

I have found lots of solutions to remap naked to www, but I don’t seem to have any URL rewrite/redirect functionality, I don’t have a web.config file, etc. being on IIS6.

I would like to support either URL being entered into a browser.

When using mobile, the button just seems “dead” when using the naked domain.