Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 713985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:01:26+00:00 2026-05-14T05:01:26+00:00

This piece of valid json (it has been generated using php’s json_encode): {html:form is

  • 0

This piece of valid json (it has been generated using php’s json_encode):

{"html":"form is NOT valid<form id=\"articleform\" enctype=\"application\/x-www-form-urlencoded\" method=\"post\" action=\"\"><dl class=\"zend_form\">\n<dt id=\"title-label\">&nbsp;<\/dt>\n<dd id=\"title-element\">\n<input type=\"text\" name=\"title\" id=\"title\" value=\"Artikel K\"><\/dd>\n<dt id=\"articleFormSubmitted-label\">&nbsp;<\/dt>\n<dd id=\"articleFormSubmitted-element\">\n<input type=\"hidden\" name=\"articleFormSubmitted\" value=\"1\" id=\"articleFormSubmitted\"><\/dd>\n<dt id=\"submit-label\">&nbsp;<\/dt><dd id=\"submit-element\">\n<input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Bewaar artikel\" onclick=\"this.value='Bezig...';\"><\/dd><\/dl><\/form><script type=\"text\/javascript\">\n\t $(\"#articleform\").submit(function(){\n $.post(\"\/admin\/ajax\/contenttree\/node\/9\/ajaxtarget\/ajaxContainer\", $(\"#articleform\").serialize(), function(html){$(\"#ajaxContainer\").html(html);} );\n\t\t return false;\n\t });\n\n <\/script>","newNodeName":""}

is giving

jQuery.parseJSON(data)

and me a hard time.

With this piece of code:

alert('start');
alert(data);
jQuery.parseJSON(data);
alert('stop');

I get a message start and then the data (jsonstring above) is shown. The message “stop” never appears.

When I use this json:

{"html":"test","newNodeName":""}

The message stop eventually appears.

$.ajax({
      url: "/admin/ajax/contenttree/node/" + (node.id).replace("node_", ""),
      success: function(data){

      //this message appears
      alert("succes");

      //this gives undefined
      alert(data.html);

      var result = $.parseJSON(data);

      //this message never appears
      alert("after parse");

        $("#ajaxContainer").html(result.html);
      }
    });

I’ve verified that my first big chunk of json is valid. Why isn’t it processed by jQuery.parseJSON
Are there any special characters that don’t go well with json?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:01:27+00:00Added an answer on May 14, 2026 at 5:01 am

    I found the answer for my problem. In my question you’ll find that I tried to pass the html inside an array with the key html. In the javascript-code I tried to get the html using

    jQuery.parseJSON(data);
    alert(data.html);
    

    When I renamed the key htmlstring the parseJSON-function worked fine. There’s no need anymore now to escape anything after the php-function json_encode does it job.

    I believe now that .html is a reserved word in jQuery, so if you want to use parseJSON don’t feed it a json with a key named “html”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This piece of code used to work in MVC 1 but it does not
I have been trying to parse for this certain piece of text in a
I noticed this piece of code in using CodeIgniter database migrations: $this->migrations->verbose AND print
I have this piece of code: ['design','finish','grills'].each(function(type) { this.json.type.each(function(obj, index) { console.log(obj); }); }.bind(this));
I want to sort an array by using uasort() function. I wrote this piece
This piece of JSON right here: {user:[{idUser:1,username:USERNAME,userFullName:FULL NAME,userEmail:EMAIL@MAIL.COM}]} Does not validate in jsonlint also
I'm trying to display a spectogram using JavaPlot with this piece of code: PlotStyle
As part of this php login and redirect software I have a piece of
This piece of code compiles and runs as expected on GCC 3.x and 4.x:
This piece of code is from Adobe docs : package { import flash.display.Loader; import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.