Search Results

Search found 5856 results on 235 pages for 'json encode'.

Page 30/235 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • GWT: How can I use JsonpRequestBuilder to handle a Json response of a list

    - by Anthony Kong
    My backend server function returns a list of json object to the caller. I would like to use JsonRequestBuilder to interact with this backend function I defined a AsyncCallback this way class MyCallBack extends AsyncCallback<List<MyObject>> { However, JsonpRequestBuilder does not this declaration AsyncCallback because the generic type is bounded to <T extends JavaScriptObject. List<MyObject does not satisfy this requirement. Do you have any suggestion to this problem?

    Read the article

  • JSON array deserialization is crashing the Dalvik VM

    - by Sam
    I have some code grabbing a JSON array from my server and initially storing it as a string. This all works fine until I try and deserialize it using google's gson fromJson method. LogCat spits out the error: 04-08 17:46:35.163: ERROR/dalvikvm(401): Can't shrink stack: curFrame is in reserved area (0x41049000 0x410491c4) My code that causes the error is: String[] results = gson.fromJson(returnString, String[].class); Can anyone shed some light on what I am doing wrong? Cheers, Sam

    Read the article

  • How Can I Use This jSON data like array

    - by mTuran
    hi, i have json data like this: {"Adobe Photoshop":"70","Adobe Premier":"71","Animasyon":"72","AutoCAD":"73","Bro\u015f\u00fcr & Bilet":"75","CorelDraw":"76","Flash":"77","Grafik Tasar\u0131m":"68","Karikat\u00fcr":"78","Kartvizit Tasar\u0131m":"79","Logo Tasar\u0131m":"80","Poster":"81","Reklam Tasar\u0131m":"74","Ses D\u00fczenleme":"82","Video D\u00fczenleme":"69","Web Tasar\u0131m":"83"} First think(Adobe Photoshop) means tag name, second thing(70) means tag id. I want to use this information in jquery like array to build checkboxes for every tag. How can i done this ? Thanks

    Read the article

  • Client-side templating frameworks to streamline using jQuery with REST/JSON

    - by Tauren
    I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate HTML into the page. Right now, when a user on my site clicks a link to My Projects, the server generates HTML like this: <dl> <dt>Clean Toilet</dt> <dd>Get off your butt and clean this filth!</dd> <dt>Clean Car</dt> <dd>I think there's something growing in there...</dd> <dt>Replace Puked on Baby Sheets</dt> </dl> I'm changing this so that clicking My Projects will now do a GET request that returns something like this: [ { "name":"Clean Car", "description":"I think there's something growing in there..." }, { "name":"Clean Toilets", "description":"Get off your butt and clean this filth!" }, { "name":"Replace Puked on Baby Sheets" } ] I can certainly write custom jQuery code to take that JSON and generate the HTML from it. This is not my question, and I don't need advice on how to do that. What I'd like to do is completely separate the presentation and layout from the logic (jquery code). I don't want to be creating DL, DT, and DD elements via jQuery code. I'd rather use some sort of HTML templates that I can fill the data in to. These templates could simply be HTML snippets that are hidden in the page that the application was loaded from. Or they could be dynamically loaded from the server (to support user specific layouts, i18n, etc.). They could be displayed a single time, as well as allow looping and repeating. Perhaps it should support sub-templates, if/then/else, and so forth. I have LOTS of lists and content on my site that are presented in many different ways. I'm looking to create a simple and consistent way to generate and display content without creating custom jQuery code for every different feature on my site. To me, this means I need to find or build a small framework on top of jQuery (probably as a plugin) that meets these requirements. The only sort of framework that I've found that is anything like this is jTemplates. I don't know how good it is, as I haven't used it yet. At first glance, I'm not thrilled by it's template syntax. Anyone know of other frameworks or plugins that I should look into? Any blog posts or other resources out there that discuss doing this sort of thing? I just want to make sure that I've surveyed everything out there before building it myself. Thanks!

    Read the article

  • Updating / refreshing a live geojson layer | JSON & JS Variable

    - by Ozaki
    TLDR I am trying to get my geoJSON layer to update, currently it will 1. Create the vector mark, 2. Remove the vector mark, 3. Set the JS variable for lat and lon, 4. Unset the variable??? :S Hey S O. I have a geojson layer set up as follows: //GeoJSON Layer// var layer1 = new OpenLayers.Layer.GML("My GeoJSON Layer", "coordinates", {format: OpenLayers.Format.GeoJSON, styleMap: style_red}); My features are set up as follows: var latitude = 0.0; // as 0.0 it will draw the point in. var longitude = 0.0; // as 0.0 it will draw the point in. //var longitude = getlongitude; where getlongitude = JSON string of longitude. var point = new OpenLayers.Geometry.Point(longitude, latitude); pointFeature = new OpenLayers.Feature.Vector(point, null, style_red); var style_red = OpenLayers.Util.extend({}, layer_style); style_red.strokeColor = "red"; style_red.fillColor = "black"; style_red.fillOpacity = 0.5; style_red.graphicName = "circle"; style_red.pointRadius = 3.8; style_red.strokeWidth = 2; style_red.strokeLinecap = "butt"; and my layer updating function: function UpdateLayer(){ var p = new OpenLayers.Format.GeoJSON({ 'internalProjection': new OpenLayers.Projection("EPSG:900913"), 'externalProjection': new OpenLayers.Projection("EPSG:4326") }); var url = "coordinates"; OpenLayers.loadURL(url, {}, null, function(r) { var f = p.read(r.responseText); map.layers[2].destroyFeatures(); map.layers[2].addFeatures(pointFeature); }); setTimeout("UpdateLayer()",1000) } Any idea what I am doing wrong or what I am missing? Edit1 It now removes the feature (was map.layers[1]) previously... But will not add the new feature.. Edit2 I managed to get it to redraw a point but not with live data. It should draw the point at what (latitude) & (longitude) are equal to. I am trying to set latitude & longitude to some JSON string but every time straight after it sets the variable it changes it back to "undefined" as soon as it passes the line after var latitude? (using firebug & firequery to debug)

    Read the article

  • JSON Beautifier

    - by Randy Mayer
    Hi, do you know any "JSON Beautifier"? Thanks! From {"name":"Steve","surname":"Jobs","company":"Apple"} To { "name" : "Steve", "surname" : "Jobs", "company" : "Apple" }

    Read the article

  • How to access a String that is in JSON array format

    - by Sayem Ahmed
    I have an asp.net page which is returning a list of object as a json string to an ajax request. The string is as follows : [ {"Name":"Don","Age":23,"Description":"Tall man with no glasses"} ,{"Name":"Charlie","Age":24,"Description":"Short man with glasses"} ] I want to access each field individually, like the name of the person, his age, his description etc. How can I do that? I am using JQuery for client-side scripting.

    Read the article

  • How to parse JSON in Java

    - by Maxood
    I have the following JSON text that i need to parse to get pageName, pagePic, post_id, etc. What is the required code? {       pageInfo: {            pageName: abc            pagePic: http://profile.ak.fbcdn.net/object2/367/65/q160119538822_4127.jpg       }       posts: [            {                 post_id: 160119538822_302076968822                 actor_id: 1183856639                 picOfPersonWhoPosted: http://profile.ak.fbcdn.net/hprofile-ak-sf2p/hs302.ash1/23104_1183856639_4894_q.jpg                 nameOfPersonWhoPosted: Andrea Raquel                 message: Sounds cool. Can't wait to see it!                 likesCount: 2                 comments: [                 ]                 timeOfPost: 1266036226            }

    Read the article

  • qooxdoo json/request transport method

    - by W55tKQbuRu28Q4xv
    Hi all, I try to send a request to my server via GET, but qooxdoo sends request as OPTIONS. Is any way to change this behaviour? I try to use qx.data.store.Json (url) and qx.io.remote.Request (url, "GET", type) but result is same in both cases. My version of qooxdoo is 1.0.1, browsers are FF 3.5.6 and Chromium 5.0.361.

    Read the article

  • $.ajax ColdFusion cfc JSON Hello World

    - by cf_PhillipSenn
    I've simplified this example as much as I can. I have a remote function: <cfcomponent output="false"> <cffunction name="Read" access="remote" output="false"> <cfset var local = {}> <cfquery name="local.qry" datasource="myDatasource"> SELECT PersonID,FirstName,LastName FROM Person </cfquery> <cfreturn local.qry> </cffunction> </cfcomponent> And using the jQuery $.ajax method, I would like to make an unordered list of everyone. <!DOCTYPE HTML> <html> <head> <script src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1"); </script> <script type="text/javascript"> jQuery(function($){ $.ajax({ url: "Remote/Person.cfc?method=Read&ReturnFormat=json", success: function(data){ var str = '<ul>'; // This is where I need help: for (var I=0; I<data.length; I++) { str += '<li>' + I + data[I][1]+ '</li>' } str += '</ul>'; $('body').html(str); }, error: function(ErrorMsg){ console.log("Error"); } }); }); </script> </head> <body> </body> </html> The part where I'm lost is where I'm looping over the data. I prefer to the use jQuery $.ajax method because I understand that $.get and $.post don't have error trapping. I don't know how to handle JSON returned from the cfc.

    Read the article

  • How to get an hierarchical php structure from a db table, in php array, or JSON

    - by daniel
    Hi guys, can you please help me. How to get an hierarchical php structure from a db table, in php array, or JSON, but with the following format: [{ "attributes" : {"id" : "111"}, "data" : "Some node title", "children" : [ { "attributes" : { "id" : "555"}, "data" : "A sub node title here" } ], "state" : "open" }, { "attributes" : {"id" : "222"}, "data" : "Other main node", "children" : [ { "attributes" : { "id" : "666"}, "data" : "Another sub node" } ], "state" : "open" }] My SQL table contains the fields: ID, PARENT, ORDER, TITLE Can you please help me with this? I'm going crazy trying to get this. Many thanks in advance. Daniel

    Read the article

  • Importing json data into MySQL?

    - by AP257
    Pretty much what the title says :) At the moment I'm using Python to turn the json data into a plain-text tab-separated file, and then mysqlimport to pull that into my MySQL tables. Anyone know a nicer / more direct way?

    Read the article

  • JSON find in JavaScript

    - by zapping
    Is there a better way other than looping to find data in JSON? It's for edit and delete. for(var k in objJsonResp) { if (objJsonResp[k].txtId == id) { if (action == 'delete') { objJsonResp.splice(k,1); } else { objJsonResp[k] = newVal; } break; } } The data is arranged as list of maps. Like: [{id:value, pId:value, cId:value,...}, {id:value, pId:value, cId:value}, ...]

    Read the article

  • Matching a value to JSON array values in jquery

    - by chrism
    I have a JSON array that looks like this: ['Monkey','Cheetah','Elephant','Lizard','Spider'] I also have a text input. I want to test whether the value of the input upon 'blur' is also in the array and if it is do something. Knowing a bit of python I tried something like this: var existing_animals = ['Monkey','Cheetah','Elephant','Lizard','Spider'] $('input').blur(function() { user_animal = $(this).val() if (user_animal in existing_animals) { alert('Animal already exists!') } }); So, how rookie is my mistake?

    Read the article

  • Need help Decoding JSON with XML

    - by brant
    I have a set of data that looks like this when using print_r($var): cbfunc({"query":{"count":"12","created":"2010-06-11T01:20:19Z","lang":"en-US"},"results":["\n 238.l.739089.t.4<\/team_key>\n 4<\/team_id>\n CHEE-HOO!!!<\/name> It looks like JSON to me, so I've tried to use json_decode but can't get it right. My goal is to print the xml data found in "results". Any helpful pointers would be greatly appreciated.

    Read the article

  • Convert json data to javascript array - in multi-dimensional sense

    - by AW-GWTF899
    I have a json array say { "People": { "Person": [ {"FirstName": "John", "LastName": "Smith"} {"FirstName": "Joe", "LastName": "Bloggs"} {"FirstName": "Wendy", "LastName": "Deng"} ] } } And I want to convert this into a javascript array (something like this) var persons = [ ["FirstName", "John", "LastName", "Smith"], ["FirstName", "Joe", "LastName", "Bloggs"], ["FirstName", "Wendy", "LastName": "Deng"] ]; How do I accomplish this? Hope my question makes sense and I realise the javascript array initialization may not be the correct way to put it. Thanks.

    Read the article

  • JSON limitation?

    - by thedp
    Hello, I would like to know if JSON with AJAX has a limitation to the amount of data an outgoing and returning parameter can carry? I would like to be able to send and return from the server a file with 10,000 lines, as a string. How should I achieve this task? Will a single parameter will be able to hand this? Thank you.

    Read the article

  • use AMF instead of JSON on iPhone?

    - by Henry
    Although iPhone support JSON natively, AMF is a binary protocol and it supposes to use much less bandwidth. Do you think using AMF is a good idea? Just found this AMF library in cocoa (Objective-C): http://github.com/nesium/cocoa-amf/

    Read the article

  • Accessing JSon raw tokens in C# ?

    - by user318332
    My json string looks like { abc: 123, def: 442, ghi=444 } - say stock list. I dont know what quotes are coming in , i.e I dont know what is abc, def etc is. I need to get this token dynamically. Any pointers would be of great help ! BTW, this has to run in silverlight.

    Read the article

  • Parse 2 dimensional JSON array in Javascript

    - by MrG
    I have a two dimensional JSON array where each element contains several attributes. The example below is intentionally simplified: var map_data = { "1": {"1":{"name":"aa"},"2":{"name":"bb"}}, "2": {"1":{"name":"cc"},"2":{"name":"dd"}} }; I try to parse the data but .length doesn't work: for(x=1; x<=map_data.length; x++) { for(y=1; y<=map_data[x].length; y++) { // CODE } } Many, many thanks!

    Read the article

  • Get the largest value from Json object with Javascript

    - by neilc
    Hi This should be an easy one. I just cant figure it out. How do I get the largest value from this piece of JSON with javascript. {"data":{"one":21,"two":35,"three":24,"four":2,"five":18},"meta":{"title":"Happy with the service"}} The key and value I need is: "two":35 as it is the highest thanks

    Read the article

  • JSON serialization of Google App Engine models

    - by user111677
    I've been search for quite a while with no success. My project isn't using Django, is there a simple way to serialize App Engine models (google.appengine.ext.db.Model) into JSON or do I need to write my own serializer? My model class is fairly simple. For instance: class Photo(db.Model): filename = db.StringProperty() title = db.StringProperty() description = db.StringProperty(multiline=True) date_taken = db.DateTimeProperty() date_uploaded = db.DateTimeProperty(auto_now_add=True) album = db.ReferenceProperty(Album, collection_name='photo') Thanks in advance.

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >