func.js:
$.get(
"test.php",
{id: theid},
function(data){...}
)
我的 test.php
和 func.js
文件位于 /scripts/data/
文件夹中,php 的完整网址为 http://site.com/scripts/data/test.php
如何在不使用相对路径的情况下获取 php 文件?
此脚本也应该适用于其他域。
谢谢。
最佳答案
您可以只使用相对路径:
$.get(
"/scripts/data/test.php",
{id: theid},
function(data){...}
)
关于php - 从同一文件夹获取 php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4873363/