0

following is my string after JSON.stringify

"chk={
    "node":"obj.1.46971",
    "user":"arslan",
    "to":"mercedes",
    "article":"<p>this my test&nbsp;</p>",
    "subject":"haha",
    "comments":"hello"
}"

I am sending it through AJAX to my JOOMLA controller

When I try to recieve chk in my JOOMLA controller it clips at & symbol and recieves only `

"chk{
    "node":"obj.1.46971",
    "user":"arslan",
    "to":"mercedes",
    "article":"<p>this my test` 

following is the line of code that I am using to receive post variables

$myJson=$app->input->get("chk","undefined",'RAW');

So how should I resolve this issue?

Roham Rafii
  • 2,929
  • 7
  • 35
  • 49
arslan
  • 565
  • 1
  • 7
  • 25

1 Answers1

1

OK i just found it after making JSON use this to escape URI special chracters like ampersand

encodeURIComponent('&')

for details How can I send the "&" (ampersand) character via AJAX?

Community
  • 1
  • 1
arslan
  • 565
  • 1
  • 7
  • 25