$(function(){
var ref=document.referrer;var url=document.URL;alert(url);
$.ajax({
  type:'GET',
  url:'/axphp/ax/core/from.php?ref='+ref+'&url='+url+'&num='+Math.random(),
  success:function(msg){
 // alert(msg);
  },
  error:function(){alert('error');}});});这里的 url 实际是: http://192.168.1.32/gongsiyou/?uid=1&ad=13&stn=mjalert(url) 也是这个值,但是到了  from.php 里没做任何处理就变成了:  http://192.168.1.32/gongsiyou/?uid=1这是何故?

解决方案 »

  1.   

    get时URL后面的&被当成了你发送的参数,因此失去了完整性
      

  2.   

    得到url后编码一下
    encodeURIComponent(url)
    或是
    escape(url)试试吧
      

  3.   

    唉,发的贴子又不见了
    encodeURIComponent(url)

    escape(url)
    试试吧
      

  4.   

    url:'/axphp/ax/core/from.php?ref='+ref+'&url='+url+'&num='+Math.random(),
    这里写的有问题,url每遇到一个&就认为是一个参数,所以你的url这个参数在第一个&之后的就没有用了。
    向楼上说的可以进行编码后传值。