如何在ajax get或post方法中传递&(&符号)?

Nav*_*ruk 4 ajax url post get query-string

我有一个文本框输入描述如果我提交需要通过ajax发送并存储在db中.

问题:-

Example text in textbox:-    "Hi all & solve my problem"

in the next page i am getting till "Hi all" 

Remaining text is missing, If I pass through get or post method using ajax.
Run Code Online (Sandbox Code Playgroud)

给我解决方案.如何获取我放在文本框中的所有内容以及"&"

n0r*_*0rd 5

你需要使用escapeencodeURIComponent函数来urlencode字符串.