Search Results

Search found 56255 results on 2251 pages for 'json net'.

Page 68/2251 | < Previous Page | 64 65 66 67 68 69 70 71 72 73 74 75  | Next Page >

  • jQuery and iterating on JSON objects.

    - by The Devil
    Hey everybody, I'm currently trying to figure out how can I iterate over all of the objects in an JSON response. My object may have endless sub objects and they may also have endless sub objects. { "obj1" : { "obj1.1" : "test", "obj1.2" : { "obj1.1.1" : true, "obj1.1.2" : "test2", "obj1.1.3" : { ... // etc } } } } I was just wondering if there is a out of the box script that can handle such kind of objects? Thanks in advance, The Devil

    Read the article

  • latest org.json

    - by cp
    Hello A simple question where can I dn the latest org.json jar? The API shows 2010/01/05 for JSONObject and my last dn was 09/06/15. I cant find it on sourceforge or anywhere else. Can someone direct to the latest that will have an API at least as specified as of 2010/01/05? tia.

    Read the article

  • How to loop a json array and update links

    - by azz0r
    Hello, On page load, I do one call to get the current status of all the favourite links (display the right message aka: click to subscribe, click to unsubscribe. So far I have the following code: $(InitFavorite); function InitFavorite(){ var jList = $(".favourite_link"); var ids_to_check = {};//new Array(); $.each(jList, function () { var id = this.id; var object = id.split("_"); if (!ids_to_check[object[1]]) { ids_to_check[object[1]] = []; } ids_to_check[object[1]].push(object[0]); }); //console.log(ids_to_check); $.ajax({ type: 'POST', url: '/user/subscription/favourite-listing', data: ids_to_check, dataType: 'json', beforeSend: function(x) { if(x && x.overrideMimeType) { x.overrideMimeType("application/j-son;charset=UTF-8"); } }, error: function() { alert(1); }, success: function(returned_values) { $.each(returned_values, function() { console.log($(this)); }) } }); } My returned data is: {"env":"development","loggedIn":true,"translate":{},"aaron":"{\"Playlist\":{\"10\":\"Stop Recieving Updates For This Playlist\"},\"Clip\":{\"26\":\"Recieve Updates For This Clip\",\"27\":\"Recieve Updates For This Clip\",\"28\":\"Recieve Updates For This Clip\",\"29\":\"Stop Recieving Updates For This Clip\",\"30\":\"Recieve Updates For This Clip\"}}"} I would like it to loop through the data and for example update the class <a href="/user/subscription/toggle/id/26/object/Clip" class="favourite_link" id="26_Clip"> <img src="/design/images/icon/subscribe.png"> Add Clip To Favourites</a> However eaching through returned_values equals this in firebug: ["{", """, "P", "l", "a", "y", "l", "i", "s", "t", """, ":", "{", """, "1", "0", """, ":", """, "S", "t", "o", "p", " ", "R", "e", "c", "i", "e", "v", "i", "n", "g", " ", "U", "p", "d", "a", "t", "e", "s", " ", "F", "o", "r", " ", "T", "h", "i", "s", " ", "P", "l", "a", "y", "l", "i", "s", "t", """, "}", ",", """, "C", "l", "i", "p", """, ":", "{", """, "2", "6", """, ":", """, "R", "e", "c", "i", "e", "v", "e", " ", "U", "p", "d", "a", "t", "e", "s", " ", "F", "o", "r", " ", "T", "h", "i", "s", " ", "C", "l", "i", "p", """, ",", """, "2", "7", """, ":", """, "R", "e", "c", "i", "e", "v", "e", " ", "U", "p", "d", "a", "t", "e", "s", " ", "F", "o", "r", " ", "T", "h", "i", "s", " ", "C", "l", "i", "p", """, ",", """, "2", "8", """, ":", """, "R", "e", "c", "i", "e", "v", "e", " ", "U", "p", "d", "a", "t", "e", "s", " ", "F", "o", "r", " ", "T", "h", "i", "s", " ", "C", "l", "i", "p", """, ",", """, "2", "9", """, ":", """, "S", "t", "o", "p", " ", "R", "e", "c", "i", "e", "v", "i", "n", "g", " ", "U", "p", "d", "a", "t", "e", "s", " ", "F", "o", "r", " ", "T", "h", "i", "s", " ", "C", "l", "i", "p", """, ",", """, "3", "0", """, ":", """, "R", "e", "c", "i", "e", "v", "e", " ", "U", "p", "d", "a", "t", "e", "s", " ", "F", "o", "r", " ", "T", "h", "i", "s", " ", "C", "l", "i", "p", """, "}", "}"] How would I successfully loop that json array? Many thanks

    Read the article

  • Spring-JSON Used in Spring MVC

    - by Mark Estrada
    Hi, I came across the library Spring-JSON while looking to add Ajax Support in my spring mvc webapp 2.5. My question is, has anybody here have used this library and what are your experiences? Is there any better alternative than this?

    Read the article

  • Converting HTML TAG Object to JSON Object

    - by cooldude
    Hi, I want to convert the html tag objects to json object in the javascript in order to send them to the server from the javascript. As i have to save these objects at the Ruby on Rails server. These HTML objects is the canvas tag object and the graphics objects created using CAKE API. I have used the stringify function but it is not working. Here is my code: var CAKECanvas = new Canvas(document.body, 1000,1000); var canvas=CAKECanvas.canvas; var text=document.createElement('textarea'); text.id="text"; text.rows="100"; text.cols="200"; document.body.appendChild(text); canvas.style.borderStyle="solid"; canvas.style.borderColor="black"; var rect= new Circle(); rect.radius=100; rect.centered=true; rect.cx=Math.random() * 500; rect.cy= Math.random() * 300; rect.stroke= false; rect.fill= "red"; rect.xDir = Math.random() > 0.5?1:-1; rect.yDir = Math.random() > 0.5?1:-1; var obj=new Object; var count = 0,k; for (k in rect) { if (rect.hasOwnProperty(k)) { count++; obj[k]=rect[k]; } } alert(count); rect.addFrameListener(function(t, dt) { this.cx += this.xDir * 50 * dt/1000; this.cy += this.yDir * 50 * dt/1000; if (this.cx > 550) { this.xDir = -1; } if (this.cx < 50) { this.xDir = 1; } if (this.cy > 350) { this.yDir = -1; } if (this.cy < 50) { this.yDir = 1; } } ); CAKECanvas.append(rect); var carAsJSON = JSON.stringify(obj); /////////////////ERROR

    Read the article

  • Python's JSON module doesn't use __get__?

    - by Matt
    When I serialize a list of objects with a custom __get__ method, __get__ is not called and the raw (unprocessed by custom __get__) value from __set__ is used. How does Python's json module iterate over an item? Note: if I iterate over the list before serializing, the correct value returned by __get__ is used.

    Read the article

  • How to loop on a JSON object?

    - by Damiano
    Hello, I have this JSON object: {"time":"123456789", "raw":"chat_history", "data":{ "msg":[ {"time":1111111111, "user":"user1", "text":"text from user1"}, {"time":2222222222, "user":"user2", "text":"text from user2"}, {"time":3333333333, "user":"user3", "text":"text from user3"}, {"time":4444444444, "user":"user4", "text":"text from user4"} ] }} I have to create a FOR to loop the elements of data.msg and print it: I would print these results with the FOR: 11111111111 - user1 - text from users1 22222222222 - user2 - text from users2 33333333333 - user3 - text from users3 44444444444 - user4 - text from users4 Could you help me? Thank you very much

    Read the article

  • jQuery, Quotes, characters etc are breaking my JSON

    - by nobosh
    I'm using json2.js to create a JSON object which JQUERY posts to the Server. The object looks like: [{"locationID":"16","locationDesc":"XXXX"}, {"locationID":"111","locationDesc":"XXXX"}, {"locationID":"12","locationDesc":"XXXX"}, {"locationID":"11","locationDesc":"XXXX"}] Problem here is that XXXX sometimes contains quotes like "we're'" etc.... How should I handle this? Do you I escape somewhere or encode in some way? Thanks

    Read the article

  • Iterating through list of keys for associative array in JSON

    - by Simon_Weaver
    I have an associative array in JSON var dictionary = {"cats":[1,2,37,38,40,32,33,35,39,36], "dogs", [4,5,6,3,2]}; Can I get the keys from this? I tried in Visual studio putting a breakpoint but can't see any property that represents keys. Is it not possible? I'm fine creating a separate array if necessary, but was just hoping it wasnt : var keys = ["cats", "dogs"];

    Read the article

  • basic JSON pulling data help..

    - by Webby
    New to json data and struggling i guess the answer is real easy but been bugging me for the last hour.. Sample data { "data": { "userid": "17", "dates": { "timestame": "1275528578", }, "username": "harino54", } } Ok I can pull userid or username easy enough with echo "$t->userid" or echo "$t->username " but how do I pull data from the brackets within ? in this case timestame? cant seem to figure it out.. any ideas?

    Read the article

  • issue with $.ParseJSON which converts json string to null

    - by Aby
    I am using spring mvc in which i convert the arraylist into json string. I have one object 1) results. My output from spring looks like this: { "data":"[{\"userName\":\"test1\",\"firstName\":\"test\",\"lastName\":\"user\"}, {\"userName\":\"test2\",\"firstName\":\"test1\",\"lastName\":\"user1\"}]", } I get output as null when i do '$.parseJSON' with this output. When i tried testing only with data object it works fine Any help would be great.

    Read the article

  • issue when outputting an http:// address in a sub-array with json and php

    - by Patrick
    Im trying to achieve an output like this {"status":"ok","0":{"id":"11","title":"digg","url":"http://www.digg.com"}} but instead i am getting this {"status":"ok","0":{"id":"11","title":"digg","url":"http:\/\/www.digg.com"}} this is the php code im using to generate the json $links = array('id'=>'11','title'=>'digg','url'=>"http://www.digg.com"); $msg = array('status'=>'ok',$links); echo json_encode($msg); any idea what is causing this?

    Read the article

  • JSON object array to store data of a form in local storage temporary (PhoneGap project)

    - by Nadeesha
    I am building a data aqusition system using PhoneGap. .I am trying to store my form data temporary on local storage using JSON,Data should be visible after I close and reopen the application (after pressing Get Data button),But after I close it only the lastly entered record is visible This is my code <!DOCTYPE html> <html> <head> <title>Household Profile DB storage</title> <meta charset="utf-8"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1,width=device-width" /> <link rel="stylesheet" href="jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css"> <link rel="stylesheet" href="css/table.css"> <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js"></script> <script type="text/javascript" src="js/iscroll.js"></script> <script type="text/javascript" charset="utf-8"> function onDeviceReady() { persistData(homeId,owner,gramaND,contactNo,address,race); } function saveLocal(form){ if (window.localStorage) { var fhomeId = form.homeId.value, fowner = form.owner.value, fgramaND = form.gramaND.value, fcontactNo= form.contactNo.value, faddress = form.address.value, frace = form.race.value; alert("hi"); var highscores = [{"homeId": fhomeId, "owner":fowner, "gramaND":fgramaND, "contactNo":fcontactNo, "address":faddress, "race":frace}]; localStorage.setItem("highscores",JSON.stringify(highscores)); alert("The data has been stored successfully."); } else { alert("Your Browser does not support LocalStorage."); } } function readLocal(){ if (window.localStorage) { var scores =[]; //Get the highscores object scores = localStorage.getItem("highscores"); scores = JSON.parse(scores); for (i=0;i<scores.length;i++){ var text = "homeId :"+scores[i].homeId +"<br>"+ "owner:"+ scores[i].owner+"<br>"+ "address"+scores[i].address +"<br>"+ "gramaND"+scores[i].gramaND +"<br>"+ "contactNo"+scores[i].contactNo+"<br>" + '<Button value="DELETE" onclick="'+scores.splice(i, 0)+'><>/Button>'; var tbodyx = document.getElementsByTagName("tbody"); var tr=document.createElement("TR"); var td=document.createElement("TD"); td.innerHTML = text; tr.appendChild(td); tbody.appendChild(tr); } } } </script> </head> <body> <div data-role="page" id="page1"> <!--/header--> <div data-role="header" data-position="inline" data-theme="b"> <a href="#" data-icon="back" data-rel="back" title="Go back">Back</a> <h1>Household Profile</h1> <a href="index.html" data-icon="home">Menu</a> </div> <!--/header--> <div id="wrapper"> <form id="userInput" action ="" method="GET"> <div data-role="content"> <div data-role="fieldcontain"> <label > Home ID </label> <input class="inputClass" id="homeId" placeholder="H0001" value="" data-mini="true" type="text"> </div> <div data-role="fieldcontain"> <label > Owner </label> <input class="inputClass" id="owner" placeholder="Aberathne" value="" type="text"> </div> <div data-role="fieldcontain"> <label class="select">GramaNiladhari Division</label> <select class="inputClass" id="gramaND"> <option value="GramaNiladhari Division 1">GramaNiladhari Division 1</option> <option value="GramaNiladhari Division 2">GramaNiladhari Division 2</option> <option value="GramaNiladhari Division 3">GramaNiladhari Division 3</option> <option value="GramaNiladhari Division 4">GramaNiladhari Division 4</option> </select> </div> <div data-role="fieldcontain"> <label > Contact No </label> <input class="inputClass" id="contactNo" placeholder="071-9545-073" value="" type="number"> </div> <div data-role="fieldcontain"> <label >Address:</label> <textarea cols="40" rows="8" class="inputClass" id="address"></textarea> </div> <div class="ui-block-a"><button type="submit" data-theme="d">Location in a Map</button></div> <div data-role="fieldcontain"> <label >Race</label> <select class="inputClass" id="race"> <option value=" Sinhalese"> Sinhalese</option> <option value=" Sri Lanka Tamils"> Sri Lanka Tamils</option> <option value=" Moors"> Moors</option> <option value=" Indian Tamils "> Indian Tamils </option> <option value=" Malays "> Malays </option> <option value=" Burghers "> Burghers </option> </select> </div> <input class="buttonClass" type="button" value="Insert Data" onclick="saveLocal(this.form);"> </div> </form> </div> <input class="buttonClass" type="button" value="get Data" onclick="readLocal();"> <!-- <p id="dhomeId"></p> <p id="downer"></p> <p id="dgramaND"></p> <p id="dcontactNo"></p> <p id="daddress"></p> <p id="drace"></p>--> <table border="1"> <tbody id="tbody"> <tr><td>test1</td></tr> <tr><td>test2</td></tr> </tbody> </table> </div> </body> </html> Also I need to expand my code to edit and delete record from local storage.

    Read the article

  • Question about JSON?

    - by Alex
    Hi all, I have a fairly simple question: In Javascript how can I return the boolean (if its found in the JSON) rather than the actual value? Example: var myJSON = { "foo" : "bar", "bar" : "foo" }; var keyToLookFor = "foo"; var found = myJSON[keyToLookFor]; if (found) { // I know I can test if the string exists in the if } // but is there a way I could just return something like: return found; // instead of testing found in the if statement and then returning true?

    Read the article

  • parsing JSON in java ?

    - by bukuai
    How to parsing JSON in java? { "code": 100, "message": "SUCCESS", "result": { "list": [ { "cardNumber": "ALUFZZ5SZ1Q5", "expireTime": 1270742400, "surplusThreshold": 4, "uid": 771292, "useTime": 1270214375, "wareId": 1145 }, { "cardNumber": "ALUFZZ5SZ1QD", "expireTime": 1270828800, "surplusThreshold": 7, "uid": 784289, "useTime": 1270302200, "wareId": 1145 }, { "cardNumber": "ALUFZZ5SZ1RC", "expireTime": 1270828800, "surplusThreshold": 10, "uid": 773664, "useTime": 1270300871, "wareId": 1145 }, { "cardNumber": "ALUFZZ5SZ1UM", "expireTime": 1270828800, "surplusThreshold": 10, "uid": 779560, "useTime": 1270282841, "wareId": 1145 }, { "cardNumber": "ALUFZZ5SZ1VT", "expireTime": 1270656000, "surplusThreshold": 2, "uid": 754099, "useTime": 1270106775, "wareId": 1145 } ], "pageCount": 61, "pageIndex": 2, "pageSize": 5, "recordCount": 308 } }

    Read the article

  • Retrieving data from a JSON sub array in javascript, where identifier starts with an integer

    - by Archie Ec
    I must be missing something simple here, but I'm having trouble retrieving data from a JSON array response. I can access objects with identifiers that start with letters, but not ones that start with numbers. For example, I can access data.item[0].specs.overview.details But I can't access data.item[0].specs.9a99.details If anyone can point me in the right direction, I'd really appreciate it. Thanks.

    Read the article

  • convert json string into array or object...

    - by qulzam
    I get some json data form the web which is like: [{"pk": 1, "model": "stock.item", "fields": {"style": "f/s", "name": "shirt", "color": "red", "sync": 1, "fabric_code": "0012", "item_code": "001", "size": "34"}}, {"pk": 2, "model": "stock.item", "fields": {"style": "febric", "name": "Trouser", "color": "red", "sync": 1, "fabric_code": "fabric code", "item_code": "0123", "size": "44"}}] How can i use it in the C# winforms desktop application. I already get this data in the form of string. All types of answer are welcome.

    Read the article

  • using json object data in jquery select

    - by Ratna
    {"names": [ {"patientName": "Ratna"}, {"patientName": "raju" }, {"patientName": "krishna"}, {"patientName": "kishore"}, {"patientName": "Kishore1"}, {"patientName": "mahesh"} ]} this is the JSON object i'm getting from Ajax call so now i want to add all patientName values to select box through jquery can any one tell me how to accomplish this ?? here i'm using $.ajax() function for ajax call thanks in advance

    Read the article

< Previous Page | 64 65 66 67 68 69 70 71 72 73 74 75  | Next Page >