rails/jquery-ujs — Issue #232: Can't turn crossDomain off with element.data('cross-domain', false)
Author: shinichinomura
Created: 2011-12-27 02:10:50+00:00
State: open

I want to turn crossDomain parameter off when I generate ajax request from http://myhost.mydomain/ to https://myhost.mydomain/ (jQuery determines the request as cross-domain one because the protocol is different between these two urls).

For the purpose I wrote as below.

$("#the_anchor_id").data('cross-domain', false);

jQuery, however, determines the request as cross-domain automatically, because jquery_ujs.js sets crossDomain parameter as null in line 105 (version 1.0.17)

crossDomain = element.data('cross-domain') || null,

I guess the line should be

crossDomain = element.data('cross-domain') === undefined ? null : element.data('cross-domain'),

Thank you.