javascript - using eval to parse the JSON string -


  function ajaxFunction () {var ajaxRequest; // Ajax makes that variable possible! Try {// Opera 8.0+, Firefox, Safari Ajax Request = New XMLHttpRequest (); } Hold (e) {// Internet Explorer Browsers {ajaxRequest = new ActiveXObject ("Msxml2.XMLHTTP"); } Hold (e) {try {ajaxRequest = new ActiveX object ("Microsoft.XMLHTTP"); } Hold (E) {// Something went wrong ("Your browser is too old to run me!"); return false; }}} // Create a function that will receive the data sent from the server ajaxRequest.onreadystatechange = function {if (ajaxRequest.readyState == 4) {$ .post ('userfind.php', function (data) { $ ("Parseed JSON: '+ ParsedJSON); var results = predicted JSONRetus; var (" # portal "); wal (data); var response = data; var parsesjesen = EVAL (' ('+ + + + + + + '); Count = parsedJSON.count; Warning (' result: '+ result +' count: 'count =';), 'json');}} AjaxRequest.open ("POST", "userfind.php" , True); ajaxRequest.send (zero);}   

blockquote, therefore I have received the above code, your people will help the above code fill the txtbox with a string, but I am not able to reach every element of the string. String is an array that uses a PHP using JSON_ADID The file belongs to.

The array is something like: [{"user_id": "2790", "freelancer_name": "", "order_id": "9121", "order" : "0.00"

What I have to do is write a code like this:

  document.getElementById ("_ proId"). Value = user_id; Document.getElementById ("_ buyerSt"). Value = freelancer_name; Document.getElementById ("_ buyerDesc"). Value = order_id; Document.getElementById ("_mngSt"). Value = orderamount; ... etc.   

Blockquote So my problem is how to split the string and get data from these 2 wars

  Var results = times JSON celt; Var calculation = Perceived JSON Coat; Warning ("+"); Warning ("+ +");   

Only me warned.

Please help me get data from the string

The array is obtained from a mysql table and it is large

< Div class = "post-text" itemprop = "text">

1.

You can use proven as JSON Library or

2. Your JSON [{"user_id": "123", ...}, {...}, {...}] will be parsed as an array.

each.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -