#1087 ✓help_request
Sascha

Question mark in JSON code breaks Ajax.Request (tested w/ 1.6, 1.7RC2)

Reported by Sascha | June 30th, 2010 @ 09:13 AM

I'm trying to send this JSON code via Ajax.Request to the server which according to jsonlint.com is valid JSON code:
{ "message": "abcdefgh?ijklmno" }

Demo code:

new Ajax.Request('/dummy', { parameters:'{ "message": "abcdefgh?ijklmno" }' });

Expected behavior:
This is what I'd expect to be the POST body:
%7B%20%22message%22%3A%20%22abcdefgh%3Fijklmno%22%20%7D

Actual behavior:
This is what's sent to the server - everything before the question mark is lost resulting in invalid JSON code:
ijklmno%22%20%7D

Changing the original code to:
'{ "message": "abcdefgh%3Fijklmno" }' works though.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages