【问题标题】:Jquery Ajax responce not working in safari..but other browser it is work fine..what is mistake here? [closed]Jquery Ajax 响应在 safari 中不起作用..但其他浏览器工作正常..这里有什么错误? [关闭]
【发布时间】:2013-04-03 10:54:24
【问题描述】:
$.ajax({
        url:'ajax.php?action=wordFind&word='+arrString,
        cache: true,
        type: "GET",
        success:function(res){
              if(res=="find") { }
        }
    });

【问题讨论】:

  • 不工作是什么意思。能具体点吗?
  • 首先检查是否有对ajax.php的请求。第二步尝试 console.log(res) 看看是否有响应对象。之后你会发现问题。
  • 'NOT WORKING' 你有任何控制台错误吗?
  • 其他浏览器在结果成功后正确设置结果但 safari 不能这样做..成功后我正在做另一个过程..
  • 你试过什么?有什么问题?除了你已经发布的代码之外,你还有什么代码?

标签: jquery ajax


【解决方案1】:
$.ajax({
        url:'ajax.php?action=wordFind&word='+arrString,
        cache: true,
        async:false,
        dataType:html,//If the response is json replace it with "json"
        type: "GET",
        success:function(res){
           console.log(res);//To check you are getting any reponse
           if(res=="find")
               {
                //Do the stuff you want.
               }
            }
    });

【讨论】:

  • 我可以给你我的在线检查链接吗?
  • 不需要 umesh-chakor
猜你喜欢
  • 2019-04-06
  • 2016-12-30
  • 2015-08-26
  • 1970-01-01
  • 1970-01-01
  • 2015-11-14
  • 1970-01-01
  • 1970-01-01
  • 2019-11-27
相关资源
最近更新 更多