json

AJAX AND JSON within Codeigniter

Hello, I have a website where I am wanting to get some query results through AJAX and JSON, but I have absolutely no idea how to do it, I have this function, public function category() { $table = $this->uri->segment(2); $content_id = $this->uri->segment(3); $data['content'] = $this->site_model->get_content($tabl...

psuedo threaded json parsing?

Adobe's JSON serialization library is very helpful, but it can lock up the UI if parsing a large string. I am wondering if it makes sense to parse JSON in a psuedo-thread (aka "chunking"). I am wondering if anyone has implemented, has suggestions for implementing, or arguments against this approach. ...

In JavaScript/jQuery, how to retrieve data that has spaces in its name?

I am retrieving JSON using jQuery's getJSON call. My problem is that some of the fields in the returned JSON have spaces in them. How do I retrieve these values from the JSON without changing the source data? See line marked "ERROR" below: $.getJSON(url, null, function(objData) { $.each(objData.data, function(i, item) { var zip ...

Java: Using GSon incorrectly? (null pointer exception)

I'm trying to get the hits of a google search from a string of the query. public class Utils { public static int googleHits(String query) throws IOException { String googleAjax = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="; String json = stringOfUrl(googleAjax + query); JsonObject hits = new Gson().fromJson(js...

if index > 0: loop; else: do only once (JSON & jQuery)

I have been doing some customization to this jQuery paging script I found here http://stackoverflow.com/questions/516754/paging-through-records-using-jquery I've got the paging working nicely, and it is handling different javascript responses appropriately. I have one problem though. The response is expecting the JSON to have an index...

Accessing JSON Object

Hello, If i have a JSON Object var Obj = { col1 : 'data' }; the value 'col1' and 'data' are dynamically created. Here i can access 'data' as Obj.col1. But want to read the value 'col1'. How to do that? ...

How can I prevent SerializeJSON from changing Yes/No/True/False strings to boolean?

I have a data struct being stored in JSON format, converted using the serializeJSON function. The problem I am running into is that strings that can be boolean in CF such as Yes,No,True,and False are converted into JSON as boolean values. Below is example code. Any ideas on how to prevent this? Code: <cfset test = {str='Yes'}> <cfset j...

Are there any proposals to amend JSON to officially allow unquoted property names?

The following is technically invalid JSON: { color: "blue", size: 14 } because the property names "color" and "size" are required by the spec to be quoted, i.e. { "color": "blue", "size": 14 } However, I've noticed that many web services that purport to return "JSON" do not quote their property names, and hardly anybody wri...

JSON eval problem

I have an ASP.net website running on two different machines, one with a Vista OS and the other with Windows Server 2003. I am using jQuery to make an AJAX call to a web method in the code-behind, that then calls a web service. On both machines, the call to the web method and web serivce executes without problem and properly formatted J...

Which is the better client for Solr + PHP?

I have two options http://www.php.net/manual/en/book.solr.php http://code.google.com/p/solr-php-client/ I read it somewhere that that 2) use JSON as output types whereas 1) use XML doc. Isn't that a property of Solr which returns doc both in JSON and XML? What other features do I have to consider before deciding? ...

convert from json to csv using python

i have a json file and i want to covert to .csv file but with python how to do this. sorry i new in using python 0 vote down check i have try import json import csv f = open('data.json') data = json.load(f) f.close() f = open('data.csv') csv_file = csv.writer(f) for item in data: f.writerow(item) f.close() but it no...

how to identify json object or json array from a json parsing text?

hi i hav one problem , i parsed xml using json parsing and get json text. now i have to get values from xml. from that json text how i can identify jsonObject, jsonArray etc... ...

AJAX, setJSONStructKey Issues with multiple sets of data

I'm working to create an autosuggest and am having problems getting the data to display correctly for the JQUERY plugin. I have a table full of customers(customerID,fName,lName) I need to create a JSON response like this: [{"id":"856","name":"House"}, {"id":"1035","name":"Desperate Housewives"}, {"id":"1048","name":"Dollhouse"}, {...

Iterate through html table using jQuery, converting the data in the table into JSON

I came across a case where I have to convert html table data into json. In this process I have to iterate through table and convert one by one(row) into array and then convert the whole array into json? Need help in iterating through table(each ow and column)? ...

Importing a module based on installed python version?

My module currently imports the json module, which is only available in 2.6. I'd like to make a check against the python version to import simplejson, which can be built for 2.5 (and is the module adopted in 2.6 anyway). Something like: if __version__ 2.5: import simplejson as json else: import json What's the best way to appr...

sychronous ajax call via jquery returning string

I am making a jquery sychronous call to ajax -- with the return type set to "json" -- however the return data is comming back as a string. Is there something I'm doing wrong, or is there away to convert the string to an object? var ajax_response = $.ajax({url:"ajx_services", async:false, type:"post", data:{method: "getItem", item_no: ...

Get Property Names In JSON Objects

I would like to get the property names from a JSON object to build a table dynamically example: var obj = { 'fname': 'joe', 'lname': 'smith', 'number': '34' }; for (var i = 0; i < obj.properties.length; i++) { alert(' name=' + obj.properties[i].name + ' value=' + obj.properties[i].value); } would alert name=fname val...

JSON Parsing in Silverlight 3.0

I have a bunch of little JSON object fragments of the form: { id: "wow", foo: 45.4, bar: "hello, world!" } By "a bunch" I mean about 6 GB worth. :-) (And yes, I know, this isn't technically JSON. The full story is that it originally came from YAML data, but I find that most "JSON" parsers can handle this subset of YAML just fine.) Cu...

Should I use YAML or JSON to store my Perl data?

I've been using the YAML format with reasonable success in the last 6 months or so. However, the pure Perl implementation of the YAML parser is fairly fidgety to hand-write a readable file for and has (in my opinion) annoying quirks such as requiring a newline at end of the file. It's also gigantically slow compared to the rest of my pr...

Issue with JSON and jQuery Iteration

I'm pretty sure it's an obvious error somewhere on this - but let me explain what I'm donig : I'm calling a PHP file via jQuery as follows : $.getJSON("/phpincs/getbucket.php?awskey="+awskey+"&awssecret="+awssecret+"&bucket="+bucket, function(json){ $.each(json,function(i,item){ $(new Option(item.name,item.name)).appendTo...