× Requests and support related to jBackend.

Remove \ from json output

  • farsian
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #6316 by farsian
Remove \ from json output was created by farsian
Hi
I want to use jbackend as a API. in the json output of jbackend , there are some backslashes in html output . for example in "content" element of articles . i tried tu use echo json_encode($response, JSON_UNESCAPED_SLASHES) instead of echo json_encode($response) in the /components/com_jbackend/views/request/view.html.php but it hasn't any effect
please help me

Please Log in or Create an account to join the conversation.

  • farsian
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #6317 by farsian
Replied by farsian on topic Remove \ from json output
here is some example of output :

<p style=\"text-align: center;\"><span style=\"color: #993300;\"><strong>This is Mine...</strong></span></p>

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #6323 by admin
Replied by admin on topic Remove \ from json output
I am not sure if this is an issue with the JSON format. You can test it here:

jsonlint.com/

Please Log in or Create an account to join the conversation.

  • farsian
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #6333 by farsian
Replied by farsian on topic Remove \ from json output
it's from json because these bacslashes doesnt't exist in the database
and please give me a solution because i need that html string to run somewhere else and those "\" dont let that string to run corectly
tnx

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #6338 by admin
Replied by admin on topic Remove \ from json output
I can't give you any solution, because there is no problem here. The JSON output from jBackend content plugin is correct and probably you are just dealing with an "escape" problem with your client.
Last edit: 7 years 2 months ago by admin.

Please Log in or Create an account to join the conversation.

Time to create page: 0.159 seconds