开发者

JQuery Ajax problem with at Chrome brower

I'm running a site (in a development environment) that has http://172.31.129.188:8888/pp/ as its base url.

From http://172.31.129.188:8888/pp/pingpong I have th开发者_Go百科is ajax call:

$.post('pingpong/check/',
    function (data) {
        alert(data);
    }
);

The problem is that while Firefox and Explorer call http://172.31.129.188:8888/pp/pingpong/check (as I want), Chrome makes a call to http://172.31.129.188:8888/pp/pingpong/pingpong/check. I've tried various combinations (like adding and removing the slashes etc) but still Chrome seems to have a different approach.

Can anyone help to unify the behavior? Thanks


In my opinion, Chrome is behaving correctly and IE/Firefox are not. URLs are either absolute with a domain, relative to the domain-base if they start with a slash (/) or relative to the current location.

If you access b/c from /a/b that should be /a/b/b/c not /a/b/c as the b is relative to the current location, it should not match part of the location and continue from there. If you need to use relative URLs try calling check/ to see if that behaves appropriately.


Make the call to /pp/pingpong/pingpong/check

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜