Skip to main content

Bug Tracker

Side navigation

#9000 closed bug (invalid)

Opened April 28, 2011 10:33AM UTC

Closed May 02, 2011 01:50AM UTC

Last modified March 14, 2012 05:52AM UTC

parseerror in jquery-1.5.1.min.js

Reported by: marcelo.benzaquen@gmail.com Owned by: marcelo.benzaquen@gmail.com
Priority: low Milestone: 1.next
Component: ajax Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

When loading json with ajax, throws a parse error while the json format is completely valid and in jquery-1.4.2.min.js loads perfectly

Attachments (0)
Change History (9)

Changed April 28, 2011 10:49AM UTC by addyosmani comment:1

component: unfiledajax
owner: → marcelo.benzaquen@gmail.com
priority: undecidedlow
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket!

Additionally, test against the jQuery (edge) version to ensure the issue still exists.

Changed April 28, 2011 12:19PM UTC by jaubourg comment:2

And ticket #9k is an ajax ticket! \\o/

Changed May 02, 2011 01:29AM UTC by anonymous comment:3

I also believe this is an error in version 1.5, 1.5.1 and 1.5.2. I receive parser errors. when running the same code in version 1.4.1 through 1.4.4. Everthing works fine.

NOTICE: I tested on the easiest web service call which returns a simple string. THE JQUERY REPORTS A PARSER ERROR.

SAMPLE CODE:

$(document).ready(function () {

djlHelloWorldRegiInitiate();

});

function djlHelloWorldRegiInitiate() {

$.ajax({

type: "POST", //GET or POST or PUT or DELETE verb

url: globalDjlScormWebServiceUrl4 + "getHelloWorld",

data: "{}",

contentType: "application/json; charset=utf-8",

dataType: "json",

success: djlHelloWorldRegiSuccess,

error: djlHelloWorldRegiFailure

});

}

function djlHelloWorldRegiSuccess(data, status) {

alert("***** helloWorld SUCCESS FROM REGI SERVICE****:" + data.d);

}

function djlHelloWorldRegiFailure(request, status, error) {

alert("***** helloWorld FAILURE FROM REGI SERVICE FAILED****:" + request.statusText);

}

THANKS IN ADVANCE: DOUG LUBEY OF LOUISIANA

Changed May 02, 2011 01:50AM UTC by rwaldron comment:4

resolution: → invalid
status: pendingclosed

The problem is that you've set dataType to JSON. If you return a "simple" string and that "simple string" isn't valid JSON, boom: Parse Error.

Changed May 02, 2011 04:04AM UTC by anonymous comment:5

i do return valid json data from the call...a simple string as json format...I have about 10 web services built on the same page(similar calls)....they all return json data. The entire page works with version 1.4.4.

but breaks with version 1.5 , 1.5.1 and 1.5.2 (i tried all 3).

The code i included is for 'sample' only. i will run more tests in the AM..but the only moving part at this time is the jquery version.

Replying to [comment:4 rwaldron]:

The problem is that you've set dataType to JSON. If you return a "simple" string and that "simple string" isn't valid JSON, boom: Parse Error.

Changed May 02, 2011 04:23AM UTC by anonymous comment:6

OK..so i have about 8 or 9 js files scripted @ the top of the code. So I isolated the web service calls into a separate file and only included the required external js files which are required to call the web services. Version 1.5.2 does work when in isolation. But still causes some type of conflict when ran with my other js files.

So when I determine which js file is causing conflicts with version 1.5.2 (but not version 1.4.4) I will post this file back. Most of these js files are shared/updated/supported in the same way jquery is.

Thanks and I will post back shortly.

Replying to [comment:4 rwaldron]:

The problem is that you've set dataType to JSON. If you return a "simple" string and that "simple string" isn't valid JSON, boom: Parse Error.

Changed May 02, 2011 04:31AM UTC by anonymous comment:7

And the file which conflicts with 1.5+ is:

jquery.validate.pack.js

version:

jQuery validation plug-in 1.7

specific version:

  • $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $

jquery.validate.pack.js was some how causing the conflict.

I am going to look around to see if a newer version of this code exists

on the internet some where.

Doug Lubey of Louisiana

Changed May 02, 2011 04:44AM UTC by anonymous comment:8

I found the fix (I had to also update the jquery.validate.min.js (to verison 1.8).

All my code works great again....

I downloaded the lastest version from his website:

http://bassistance.de/jquery-plugins/jquery-plugin-validation/

He also has stated it was tested on all version 1.5+ frameworks.

Thanks for the allowing me to talk through the problem.

-doug

Changed May 02, 2011 06:27AM UTC by rwaldron comment:9

Glad you were able to resolve this and thanks for posting the results here for others :D