2011-02-18 53 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/] –