Home > Backend Development > PHP Tutorial > ajax url不管是相对取值

ajax url不管是相对取值

WBOY
Release: 2016-06-23 09:15:11
Original
847 people have browsed it

$.ajax({
                    url:"native.ajax.php?id=" + escape(orderid),
                    type:"GET",
                    dataType:"json",
                    data:"",
                    success: function (data) {
                        if (data==1) {
                            window.location.href = "../";
                        }
                    }


http://www.a.com/user/pay/index.php
include加载了wx目录下的native.php文件,这个文件里包含了上面的ajax

URL如果用http://www.xx.com/user/pay/wx/native.ajax.php?id=" + escape(orderid)就可以取到值

但是相对路径wx/native.ajax.php、./wx/native.ajax.php还是native.ajax.php

换成绝对路径/user/pay/wx/native.ajax.php都不行。这怎么回事呀?


回复讨论(解决方案)

微信操作必须配置域名

并在该域名下的链接

微信操作必须配置域名

并在该域名下的链接

都配置了,我的问题是使用完整URL就可以自动跳转,使用相对地址和绝对地址簿跳转。。

不过已经搞定了,原因是我家了一个判断造成的。积分给你吧!
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template