admin管理员组文章数量:1290086
I need to pass html code with QueryString because im using ajax method to send post(i mean ment 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
I need to pass html code with QueryString because im using ajax method to send post(i mean ment 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
Share Improve this question edited Sep 22, 2012 at 12:35 timu asked Jul 8, 2010 at 14:54 timutimu 8387 gold badges20 silver badges41 bronze badges 2- POST semantics doesn't pass parameters on query string. so this question is somewhat confusing. – Scott Evernden Commented Jul 8, 2010 at 15:07
- You can get some value back also with POST. The question to ask yourself when choosing between GET and POST is: does the query changes the state of the server? – dolmen Commented Jul 8, 2010 at 15:21
3 Answers
Reset to default 8Don'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.
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.
http://www.mywebsite./index.html?html_code=Hi%20everybodyWhats'up.
本文标签: javascriptHow to pass HTML code in query stringStack Overflow
版权声明:本文标题:javascript - How to pass HTML code in query string - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741431969a2378414.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论