mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 00:02:21 +09:00
Implement isSameOrigin() to simplify origin determination
This commit is contained in:
parent
14300cbcc3
commit
e82e3fb18c
2 changed files with 17 additions and 6 deletions
|
|
@ -47,9 +47,7 @@
|
|||
}
|
||||
|
||||
// Check whether this is a cross-domain request. If so, use an alternative method.
|
||||
var _u1 = $("<a>").attr("href", location.href)[0];
|
||||
var _u2 = $("<a>").attr("href", url)[0];
|
||||
if (_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(url, params);
|
||||
if (!isSameOrigin(location.href, url)) return send_by_form(url, params);
|
||||
|
||||
// Delay the waiting message for 1 second to prevent rapid blinking.
|
||||
waiting_obj.css("opacity", 0.0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue