/    Sign up×
Community /Pin to ProfileBookmark

Issue with Ajax.request + JSON

Hi guys,
I’m making this ajax call:

[CODE] url = “/GeoAdaptaApp/geoLogger/logGuiEvents?json=”+aLotOfJSONStuff;
encUrl = encodeURI(url,”UTF-8″);

new Ajax.Request(encUrl, {
method: ‘get’,
onSuccess: this.sendQueueToServerSuccess( this,logConsole ),
onFailure: this.sendQueueToServerFailure( this,logConsole )
}); [/CODE]

The JSON string seems correct (I checked it with a validator) and it worked on an Ajax.updater (but i need a request now).

Firefox keeps telling me:

Error: [B]no element found[/B]
Source File: http://localhost:8080/GeoAdaptaApp/geoLogger/logGuiEvents?json=%7B%22eventsQueue%22:%5B%7B%<JSON stuff>
Line: 1

The call always end up in the onFailure block.

Full request here: [url]http://tinyurl.com/y8oh968[/url]

It’s very strange, any idea about what it could be? Is there a better way to pass json objects to the server?

Thanks,
Mulone

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 09.2010 — Nearly 9000 character. Probably exceeding the limit for GET
×

Success!

Help @Mulone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...