我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

PHP中的相对URL

I'm sending an ajax request with relative url

 $.post("wp-content/themes/site/function.php", {

    }, function (data) {});

It's working fine if my url is http://yourdomain.com/page. But if the url is http://yourdomain.com/page/

then it's sending http://yourdomain.com/page/wp-content/themes/site/function.php. but I want http://yourdomain.com/site/wp-content/themes/function.php

try with a leading /:

$.post("/wp-content/themes/site/function.php", {}, function (data) {});

近期文章

  • Google Map Ajax加载
  • 如何突破innerHTML的大小限制?
  • Ajax对Python的调用
  • PHP和AJAX问题?
  • 调试Ajax流
  • JSON和Highcharts
  • jQuery新手-对话框
  • 切换AJAX请求
  • AJAX和高速公路
  • 阿贾克斯WordPress的职位
  • 多种形式的Ajax发布
  • JSON回调问题
  • jQuery中的divs
  • 读取JS变量
  • 验证模态形式
  • AJAX投资组合页面
  • Ajax表单不会发布
  • 加入ajax结果?
  • AJAX中的POST方法
  • Ajax和mysql中的限制

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华