#8454 closed bug (duplicate)
Error with using method getJSON in jQuery 1.5.1
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | ajax | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I've used in my project jQuery 1.4.4, decided to move to version 1.5.1 and I have a problem with method getJSON.
My JS code:
$.getJSON("<s:url action="checkRegistryErrorsNumber" includeParams="none" />", {"registry.id": <s:property value="registry.id" />}, function(data) { $("#errorsNumber").text(data.errorsNumber); if (data.errorMessage != "") { $("#messagesBlock").html(data.errorMessage); } });
I'm using Struts 2.0.14 and you see some struts tags from jsp page. That is response:
<%@page contentType="application/json;charset=UTF-8"%> <%@taglib prefix="s" uri="/struts-tags"%> { "errorsNumber": "<s:property value="registry.errorsNumber" />", "errorMessage": "<s:actionerror />" }
Using jQuery 1.4.4 - all OK Using jQuery 1.5.1 - error in FF : "Invalid label"
What has changed in the new version? Why the request has not working? Bug in jQuery?
Change History (4)
comment:1 Changed 11 years ago by
Component: | unfiled → ajax |
---|---|
Owner: | set to [email protected]… |
Status: | new → pending |
comment:2 Changed 11 years ago by
This was code from jsp-page with using struts taglib.
This is generated final code:
$.getJSON("/eirc/eirc/checkRegistryErrorsNumber.action", {"registry.id": 131}, function(data) { $("#errorsNumber").text(data.errorsNumber); if (data.errorMessage != "") { $("#messagesBlock").html(data.errorMessage); } } );
This is response content in Chrome:
{ "errorsNumber": "157714", "errorMessage": "" }
This is error in Chrome:
Uncaught SyntaxError: Unexpected token :
d.d.extend.globalEvaljquery-1.5.1.min.js:16 d.ajaxSetup.converters.text scriptjquery-1.5.1.min.js:16 bQjquery-1.5.1.min.js:16 vjquery-1.5.1.min.js:16 d.support.ajax.d.ajaxTransport.send.cjquery-1.5.1.min.js:16
comment:3 Changed 11 years ago by
Resolution: | → duplicate |
---|---|
Status: | pending → closed |
Is this some kind of template code? If not, then you'll need to provide a reduced test case, because this code is full of syntax errors.