views:

71

answers:

3

I need to pass html code with QueryString because im using ajax method to send post(i mean comment not the type of method) on my web site. When I write a post like that.

"Hi everybody<br />Whats'up."

its just taking "Hi everybody" removing rest of the content.

Info : Im using GET Method, beacuse i need to get some values back..

A: 

What method are you using - GET or POST? You should be using POST. That will allow you to send full html and you don't need to use the querystring.

David Radcliffe
+1 I see no reason for a downvote here. Suggesting POST is perfectly reasonable and moreover a preferred solution.
Anurag
@Anurag: I didn't downvote, but this isn't an answer to the question and it should be a comment. Moreover, even if the OP had taken this advice the problem still stands - POST data still needs URL encoding.
Andy E
A: 
http://www.mywebsite.com/index.html?html_code=Hi%20everybodyWhats'up.
JohnB
+2  A: 

Don't use escape, it's a deprecated function. Use encodeURIComponent instead:

encodeURIComponent("Hi everybody<br />Whats'up.");

Also, don't forget about Internet Explorer's 2,083 character limit in the address bar, you should use POST instead of GET if you want to avoid it.

Andy E
Cool! I am deleting my answer then.
Pablo Santa Cruz
Ok i'm using it thank you so much..And also thanks espacially Pablo Santa Cruz for interested in my problem.
Ümit Akkaya