javascript - How to call script via ajax crossdomain -
can me make request via ajax crossdomain?
what have:
$.ajax({ type: "post", url: "/login.php", data: { email: document.loginform.email.value, password: document.loginform.password.value, } }).done(function(msg){});
i'm calling https://m.domain.com/login.php - works. but, want call same script login.php on domain.com.
as guess i'm working on mobile version of website. want make post requests m.domain.com scripts situated on domain.com
using absolute address like: url: "https://domain.com/login.php",
- no success..
i tried make url "/home/admin/web/domain.com/public_html/"
ajax request.. still no result..
you should allow cors https://m.domain.com on https://domain.com/login.php.
Comments
Post a Comment