Originally posted by prashant bhardwaj:
just doing a POST will do?
Your monitor blew up? (Just saying "it doesn't work" isn't useful.)I think I tried that earlier but did not work.
Incorrect. I can be as wrong as anyone else, but in this case, I'm not.But being a author, you can't be wrong.
Can you educate me more about the need to encode ?
The browser takes care of it when you submit a form. Check out the encodeURIComponent() method.We don't always do it when we do not use AJAX.
Even better, may be you can give me a link or something to implement AJAX in a better way then a raw way like this. I mean, something which can get me started quickly.
post does not use ? in the parameter list.
In send(), pass the properly encoded query string (without a leading ?)
Yes, just as if you were going to pass it on the URL for a GET.Originally posted by prashant bhardwaj:
Assuming that the query string contains form data,
You are required to encode it. Otherwise, special characters in the data (like =, and space, and & etc) will screw up the decoding on the server.lets say I do not require to encode the data.
Only if you want to send the data to the server. In other words: yes. Otherwise, how is the data going to get sent?Is it still mandatory to pass the not encoded query string here?
In other words: yes. Otherwise, how is the data going to get sent?
We have to append the data as query string
To that question: yes.Originally posted by prashant bhardwaj:
We ALWAYS need to "manually" handle the form data if we are sending it through AJAX, irrespective of whether we do a GET or a POST.
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|