jQuery 1.5 ajax请求出错 [英] jquery 1.5 ajax requests are erroring

查看:123
本文介绍了jQuery 1.5 ajax请求出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图升级到jQuery 1.5,我所有的ajax调用都中断了.我正在运行firefox,它给了我一个无效Label的javescript错误 我正在使用php的json_encode 这是我的json响应

trying to upgrade to jQuery 1.5 and all my ajax calls break. I'm running firefox and it gives me a javescript error of invalid Label I'm using php's json_encode here is my json response

{
    "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中都能正常工作

all this works fine in jquery 1.4.2

认为我将不得不等待升级,但以为我会检查一下是否有人解决方案?

think I'll have to wait to upgrade but thought I would check and see if anyone else had a solution ?

推荐答案

好,所以我经过一番搜索后找到了正确的解决方案,发现了一个错误报告(适用于jQuery Validate).在报告的底部,validate的作者提供了一个分叉的版本,该版本在所有人的帮助下解决了该问题.

Ok so I found the correct solution after some searching I found a bug report for the jQuery Validate. At the bottom of the report the author of validate provides a forked version which fixes the problem thanks to all for help

这篇关于jQuery 1.5 ajax请求出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆