json

How to access JSON Array elements returned from an AJAX response

how to access JSON array elements for the following JSON Code? further how do i calculate the size of the returned object array? [ { lastInvAmt: 0 bwHrs: 0 nbwHrs: 0 unbilledAmt: 0 unbilledHrs: 0 dbID: 0` },{ lastInvAmt: 0 bwHrs: 0 nbwHrs: 0 unbilledAmt: 0 unbilledHrs: 0 dbID: 0` }] ...

Cannot render events on FullCalendar from JSON feed

Hi, I got a page that returns json info from a cfc. the json looks like this: [{"allday":true,"title":"event1","userid":1,"end":"","classname":"","editable":true,"start":"2010-09-01","id":1,"url":""},{"allday":true,"title":"event2","userid":1,"end":"","classname":"","editable":true,"start":"2010-09-10","id":2,"url":""},{"allday":true,"t...

JSONP To Acquire JSON From HTTPS Protocol with JQuery

Hi Everyone! I'm trying to acquire a JSON which is being sent from an https secure site, The client was hoping not to use any Server-side languages (the whole thing in Javascript) I've read that I must use JSONP in order to load a JSON from a secure site, when using the .ajax function from Jquery. My first question would be what for...

Convert JSON dates without timezone

I have a webservice that returns for example a DateTime object: DepartureDate. I use ajax to fetch this and in my view I convert the JSON date string to a javascript date object with this function: function convertToDate(jsonDate) { return eval("new " + jsonDate.substring(1, jsonDate.length - 1)); } The problem is that new Date() ...

YUI 3: Setting request headers with DataSource.IO

I need to retrieve a JSON resource which requires HTTP Basic authentication. Therefore, I need to set a request header for a DataSource.IO object. I see that the IO utility itself supports a header key in its configuration object. However, since I'm new to YUI, I can't figure out how to set this configuration value through the mediation...

JQuery's getJSON() not setting Accept header correctly?

It looks like people have had issues with Accept headers in the past, but I'm not sure my issue is related. Using jQuery 1.4.2, I'm having trouble getting JSON with getJSON(). I can watch the request / response in Firebug and it looks like the source of the problem is that the resource in question returns different results depending on...

Can I validate an entity before saving the changes?

I have a very simple WCF Data Services application and I am doing some basic CRUD operations. I have a ChangeInterceptor on the entity set that is changing, but the object in the ChangeInterceptor is the current state in the database, not what is sent in the HTTP PUT. Is there a way to validate the properties of the object before saving ...

How do you form an array in a JSON object for a query string?

When sending an array in a JSON object in a query string, is each array element supposed to have the same key? For example, if I have this JSON object: {"sodas[]": ["coke", "sprite", "fanta"]} Should the query string look like this, with all the keys exactly the same (sodas%5B%5D)? sodas%5B%5D=coke&sodas%5B%5D=sprite&sodas%5B%5D=fan...

Ajax success, how to refresh response every minute

Hi, I am really confused by this few lines of code that should work in my opinion. Div is updating when using .html, but not when using custom script. I have a couple files, index.php and test.php index contains: $(document).ready(function () { setInterval(function () { $(function () { $.ajax({ ...

How do i specify a colspan on jquery datatables from ajaxsource?

I use the following code to fetch a json and load it as content for a blank table which is added dynamically to the DOM by: $('#a_dialog').html('<table cellpadding="0" cellspacing="0" border="0" class="display" id="tbl_random_number"></table>'); The reason for this is because I find it easier to construct a JSON object than to create a...

jCarousel infinity ajax load (browser compatibility?)

Dear all, I tried to use jCarousel to create a sort of image display gallery, it will first load a few images and then load some more dynamically when clicking "next" or "prev". Everything work fine in clicking "next" but it acting weird when loading ajax in clicking "prev" in working in chrome and IE 8. I suspect the problem would be ...

Convert json object to json string and use it's functions?

I have a json object with a function: var thread = { title: "my title", delete: function() { alert("deleted"); } }; thread.delete(); // alerted "deleted" thread_json = JSON.encode(thread); // convert to json from object thread_object = JSON.decode(thread_json); // convert to object from json thread_object.delete(...

jQuery Ajax Accessing json

I have been trying to access certain part of the json response, however I am unable to do so. json = '{ "now": "2010-09-23 22:06:53 EST", "data":[ {"id":"1","year":"2010","month":"09","day":"23","hours":"08","minutes":"09","seconds":"25"},{"id":"8","year":"2010","month":"09","day":"23","hours":"08","minutes":"09","seconds":"18"}, ...

Json and Gson in Android Application.

Hello Team, Can I have the Information of what is the difference between JSON & GSON. I have read the word GSON at some places while looking for JSON particularly. I don't know the clear difference between the two. Another thing is the Words; "Marshalling" and "Unmarshalling" associated with JSON Parsing, I wonder what they are actual...

JSON Deserializing with Json Parsing in Android Application

Hi Team, What is "deserializing Json" means, I had seen this term on the Web. I don't know the meaning od this particular term So, it would be great if anybody can explain me about What it means actually? Thanks, david ...

JSON decode a single array

I have an array like this: Array st = [[234,412,42]] Does anyone know who to get JSON decode code which give [234,412,42]? (The inner array). The output should looks like this [234,412,42]. In Java Thanks ...

Need help with Flickr/JSON/Javascript issue when displaying gallery images

Hi all, Wondering if anyone can help me. I'm trying to put together a weekly photo competition page by pulling in photos from a Flickr gallery, but I can't get the images to display. It works OK for groups, but having some problems with the gallery code. Getting the correct JSON response, but can't get the results to display on the page...

Get Latitude and Longitude from Google GeoCoder Json? [C#]

Hi, I get the Json from google. it has many details on many things but I just want the longitude and latitude. I have been successfully deserialized json using: JavaScriptSerializer jSerialize = new JavaScriptSerializer(); //var businessObject = jSerialize.Deserialize<string>(configuration); Hashtable businessOb...

Jersey @Provider not recognized

We are using a Jersey JAXBContext resolver implementation using @Provider. It appears that Jersey is not recognizing the @Provider class - the code is never being executed. Is there a reason that Jersey/JBoss isn't properly identifying the class? ...

Jersey JSON marshalling of empty lists

We have a Java List of objects which is marshalled via JSON which is created by Jersey. The List is called "rows". When there is data we have: {"records":"1","page":"1","total":"1","rows":[{"id":"692334","cell":["ECS","D","201009","","0","ABCD","11","11","","201009"]}]} When there is no data we have: {"page":0,"records":0,"total":...