来自子文件夹的Ajax

时间:2013-05-21 14:38:26

标签: jquery ajax path relative

我目前尝试从子目录中进行ajax调用,但得到404错误。

文件结构:

public_html
  - m
    - index.php

  - includes
    - s
      - c
        - index.php
        -script.php

的index.php

m/index.php我使用require_once加载includes/s/c/index.php

includes/s/c/index.php我有

$.get('/includes/s/c/script.php',
{i:"2"},
    function(response){

            alert('working')
        }
    );
    });

这适用于index.php,但不适用于m / index.php。给出了404代码。 如何调整路径以便script.php可以从m / index.php

调用

编辑: 我刚刚发现它可能是由于跨站脚本。实际上,m文件夹是移动网站的版本。 所以,我从m.mysite.com调用属于mysite.com的script.php 我该怎么做才能解决我的问题?

0 个答案:

没有答案