dongyao2129 2016-04-21 18:52
浏览 68
已采纳

如何通过ajax跨域调用脚本

Can you help me to make request via ajax crossdomain?

what i have:

$.ajax({
        type: "POST",
        url: "/login.php",
        data: {
        email: document.loginform.email.value,
        password: document.loginform.password.value,
        }
      }).done(function(msg){});

i'm calling it FROM https://m.domain.com/login.php - it works. But, i want to call same script login.php which is on domain.com.

As you could guess i'm working on mobile version of website. i want make post requests from m.domain.com to scripts that is situated on domain.com

Using absolute address like: url: "https://domain.com/login.php", - no success..

i also tried make url like "/home/admin/web/domain.com/public_html/" for ajax request.. still no result..

  • 写回答

1条回答 默认 最新

  • dongli4711 2016-04-21 19:04
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 matlab计算中误差
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊