前台JScript code    .ajaxValidator({ type : "GET", url : "http://w406750.s182.ufhosted.com/stylist_module/register.php?callback=?", datatype : "jsonp", jsonp: 'callback', success : function(callback){ alert("Data load:"+callback.modify); $("#result").html(callback.modify); if(callback.modify == null ) { return true; } else { return false; } }, buttons: $("#button"), error: function(){alert("服务器没有返回数据,可能服务器忙,请重试");}, onerror : "该用户名不可用,请更换用户名", onwait : "正在对用户名进行合法性校验,请稍候..." });
后台PHP code    $usernames = trim($_GET['username']); //获得用户名 //$result = 1; //$result1 = 2; if ($usernames) { if ($user->checkUserName($usernames)) { //查询数据库用户名是否存在 $result=$uesrnames; } else { $result=$usernames; } $k = $_GET['callback']; echo $k."({modify:".json_encode($result)."})";exit; //return; }我现在按他们说的用跨域传递来做,存在用户名显示出来,没有的话就显示null,但还是在别人机子上面错误,而我本机可以指点下。。

解决方案 »

  1.   

    ie6 ie7 不行 怪了 
    ff chrom正常
      

  2.   

    <script language="JavaScript" type="text/javascript" src="http://w406750.s182.ufhosted.com/stylist_module/common/js/formValidator.js" charset="UTF-8"></script>
    加上这句看下
      

  3.   

    我已经在你上一个帖子里说过了,你的Ajax应用有缓存。这样在 ie 系列浏览器中是得不到正确结果的
      

  4.   

    IE内核的浏览器都不行,用w3sc浏览器如FF就没问题了,不知道哪个类库出了问题~~
      

  5.   

    哦,谢谢提醒,但我增加了解决缓存的代码还是不行呢,在IE系列上都没结果,其它浏览器有。。
    url : "http://w406750.s182.ufhosted.com/stylist_module/register.php?callback=?timestamp=" + new Date().getTime(),和这
    <META   HTTP-EQUIV="pragma"   CONTENT="no-cache">  
    <META   HTTP-EQUIV="Cache-Control"   CONTENT="no-cache,   must-revalidate">  
    <META   HTTP-EQUIV="expires"   CONTENT="Wed,   26   Feb   1997   08:21:57   GMT">,真是晕死,到底问题出在哪里,我也测试了好久都没解决