2011-02-18 51 views
0

试图升级到jQuery 1.5和所有我的ajax调用中断。我运行Firefox和它给了我无效标签 我使用PHP的json_encode 这里的javescript错误是我的JSON响应jquery 1.5 ajax请求错误

{ 
    "page": "1", 
    "total": 9651, 
    "rows": [ 
     { 
      "cell": [ 
       "story", 
       "51438", 
       "Skin color: Handy tool for teaching evolution", 
       "2011-02-20 08:30:26" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51435", 
       "Photosynthesis may hold key to production of cheap hydrogen for fuel", 
       "2011-02-19 10:00:03" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51478", 
       "Dancers, supporters ready for THON 2011 Feb. 18-20 at Jordan Center", 
       "2011-02-18 14:26:25" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51420", 
       "Juggling languages can build better brains", 
       "2011-02-18 13:30:44" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51434", 
       "Multiple approaches necessary to tackle world's food problems", 
       "2011-02-18 13:30:44" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51436", 
       "U.S. will no longer dominate science and research, study finds", 
       "2011-02-18 13:00:49" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51492", 
       "NPR to air interview with Penn State professor today (Feb. 18)", 
       "2011-02-18 11:20:10" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51437", 
       "Research universities play a major role in national security", 
       "2011-02-18 10:30:28" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51472", 
       "Paterno's necktie from 400th win nets $10,200 for Public Broadcasting", 
       "2011-02-18 09:20:52" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51363", 
       "PSU Extension offers free tax preparation help for low-income families", 
       "2011-02-18 01:32:04" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51477", 
       "Students set to produce complete THON coverage, including webcast", 
       "2011-02-17 15:24:47" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51385", 
       "The Medical Minute: Seasonal Affective Disorder", 
       "2011-02-17 12:27:30" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51345", 
       "Abington professor's new book exposes NBA betting scandal", 
       "2011-02-17 11:59:31" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51360", 
       "Student Stories: Statistical service internship makes it all add up", 
       "2011-02-17 11:12:32" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51453", 
       "Parking Office announces parking, transit changes related to THON", 
       "2011-02-17 11:02:46" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51444", 
       "Penn State's Lunar Lion team aims to land vehicle on moon by 2015", 
       "2011-02-17 08:17:12" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51427", 
       "Students flock to Spring Career Fair", 
       "2011-02-16 12:56:27" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51419", 
       "Ice Campaign receives $1 million gift from Paul and Nancy Silvis", 
       "2011-02-16 10:51:45" 
      ] 
     }, 
     { 
      "cell": [ 
       "story", 
       "51353", 
       "CarbonEARTH program facilitates science education, teaching", 
       "2011-02-15 15:59:04" 
      ] 
     } 
    ], 
    "messages": null 
} 

所有这些工作在jQuery的精细1.4.2

想我将不得不等待升级,但我想我会检查并看看是否有其他人有解决方案?

回答

2

好吧,所以我找到了一些搜索后的正确解决方案,我发现了一个bug report的jQuery验证。在报告的底部,验证的作者提供了一个分叉版本,它可以解决问题,这要感谢所有人的帮助。

1

最有可能碰巧由于jquery.validate.js错误。有一个快速(不推荐!)修复程序jQuery.ajaxSetup({ jsonp: null, jsonpCallback: null}); - 如果它适合您,请进一步查看版本1.5中的“无效标签”问题的不同选项there is a discussion

+0

到目前为止,如果我将jQuery.validate.js带出问题,以及您给我的修复修复了问题,我将查看您现在链接的讨论。 – mcgrailm

+0

你能告诉我使用你的修复程序的缺点是什么? – mcgrailm

+0

@mcgrailm - 如果你需要使用jsonp进行混搭等,这会妨碍你的工作。 关于JSONP的更多信息:[http://www.ibm.com/developerworks/library/wa-aj-jsonp1/] –