How To Pass Html Code In Query String
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 everyb
Solution 1:
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.
Solution 2:
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.
Solution 3:
http://www.mywebsite.com/index.html?html_code=Hi%20everybodyWhats'up.
Post a Comment for "How To Pass Html Code In Query String"