-
Feb 1st, 2012, 06:10 PM
#1
-
Feb 1st, 2012, 06:30 PM
#2
Re: Wow - can't pass ?? in ajax web service call
The question mark is a control character in HTTP requests.
Check out
http://stackoverflow.com/questions/5...cutive-questio
-
Feb 1st, 2012, 06:52 PM
#3
Re: Wow - can't pass ?? in ajax web service call
Thanks - that link deals directly with this problem - although I'm not sure I see a simple answer in that link - I've to to eat dinner and come back to this later!
-
Feb 1st, 2012, 08:19 PM
#4
Re: Wow - can't pass ?? in ajax web service call
That link was all over the place - and the solutions offered were not strong.
Did you google for that - or do you know that to be a solution to this issue?
I'm about this "close" to escaping the ?? marks - can I do that somehow?
Like with
\u#### for the question marks?
Or do I have to roll my own internal escaping for this?
-
Feb 1st, 2012, 09:54 PM
#5
Re: Wow - can't pass ?? in ajax web service call
I couldn't reproduce your issue. It could be that it has been fixed in the jQuery source.
This works for me using jQuery 1.7.1:
Code:
var obj = { 'foo': '??' };
$.ajax({
type: 'POST',
url: 'http://localhost/test10.php',
contentType: 'application/json; charset=utf-8',
data: JSON.stringify(obj),
success: function(msg) {
console.info(msg);
}
});
This sends the JSON string as the body of the POST request. While this is valid HTTP, it is atypical. Usually POST requests consist of a set of name/value pairs, which is denoted by the content type application/x-www-form-urlencoded.
You can send a request of this form using $.post:
Code:
$.post(
'http://localhost/test10.php',
{'json': JSON.stringify(obj)},
function(msg) {
console.info(msg);
}
);
Note that in this case, the JSON string is passed as a parameter named 'json'.
-
Feb 2nd, 2012, 05:29 AM
#6
Re: Wow - can't pass ?? in ajax web service call
Yes - it's fixed in jQuery 1.7.1
Here was the bug ticket - seems they didn't believe/understand the problem for quite a while!
http://bugs.jquery.com/ticket/8417
btw - I'm talking to asp.net web services with this app - so IIS is doing the unraveling of the ajax calls...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|