weixin_33695450 2014-09-09 06:22 采纳率: 0%
浏览 19

来自子域的Ajax呼叫

I have folders

/ 
includes/class
ajax
m

m is my subdomain and i want to call ajax script ajax/delete_cart.php from includes/class/class.cart.php. In fact i can call from my root typing like "ajax/delete_cart.php"

But the problem is subdomain. I tried to do like this "../ajax/delete_cart.php" but it is not working. What should i do ? I read about cross domain (Setting a cookie on a subdomain from an ajax request) But it is not clear for me.

  • 写回答

1条回答 默认 最新

  • weixin_33671935 2014-09-09 06:41
    关注

    Browsers don't know about the directory structure of your server. If your URL is on a different hostname, then you need to include that in the URL

    //m.subdomain.example.com/ajax/delete_cart.php
    

    This will be subject to the same origin policy.

    评论

报告相同问题?

悬赏问题

  • ¥15 无法输出helloworld
  • ¥15 高通uboot 打印ubi init err 22
  • ¥20 PDF元数据中的XMP媒体管理属性
  • ¥15 R语言中lasso回归报错
  • ¥15 网站突然不能访问了,上午还好好的
  • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
  • ¥15 semrush,SEO,内嵌网站,api
  • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
  • ¥15 振荡电路,ADS仿真
  • ¥15 关于#c语言#的问题,请各位专家解答!