1
голосов
3ответов
1187 просмотров

parse json array which contains sql array

My question: How can I parse a json array? I send it like this: $data= mysql_fetch_array($r); header('Content-type: application/json'); ?> { "check": "<?php echo $check?>", "productcode": "<?php echo $code?>", "values": [<?php echo $data?>] } &l...

1
голосов
3ответов
3945 просмотров

Sending a Hashtable to a Webservice

Im trying to send a List of Items with generic Keys and Value Types to a asp.net webservice. How can i do this? I tried it with List<Dictionary<String, String>>, but this doens't work. I do not get an exception, but when i break in the webserivice, my collection is null. The Data coul...

0
голосов
1ответов
2560 просмотров

Problem with JSON in Grails

Im toying with grails but i'm having troubles when render JSON in the controller, i have this code import grails.converters.* class CourseController { def index = { redirect(action:list,params:params) } // the delete, save and update actions only accept POST requests ...

4
голосов
2ответов
13340 просмотров

JSON.net problem with JsonConvert.DeserializeObject

I have the following code and json: public class Labels { public Labels() {} public Label[] Label {get;set;} } public class Label { public Label() { } public string Name { get; set; } public int TorrentsInLabel { get; set; } } //... Labels o = JsonConvert.Deseriali...

1
голосов
3ответов
187 просмотров

Is JSON still used in applications

I wanted to know if JSON is still used in live applications? I am creating a service and want to understand if I should output data using JSON too? What is the latest standard now?

2
голосов
2ответов
780 просмотров

Serializing a subsonic class to JSON

As the question goes , how do i go about serializing a subsonic class to JSON. While i can manually create the JSON object i need some way to do it automatically. Any recommendations would be awesome as i don't really want to do this manually. Could you also please recommend a could Library to h...

3
голосов
5ответов
3870 просмотров

c# Parse json Date?

I get a json date from a webservice that i need to parse manualy and the date looks like this: "Fri, 06 Nov 2009 00:00:00 -0800" How would i parse this into a datetime object? I guess i should use DateTime.ParseExact but what do i feed into it.

1
голосов
1ответов
1869 просмотров

$.getJSON Sends Null Parameters to MVC Controller

I'm using JQuery's getJSON method to retrieve some data from an MVC controller. [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetContacts(int? numberOf) { List<Contact> contacts = (numberOf != null && numberOf > 0) ? _provider.G...

0
голосов
2ответов
353 просмотров

display image preview in Html

i want to display image after it upload i write following code but it did't work onFileSuccess: function(file, response) { var json = new Hash(JSON.decode(response, true) || {}); if (json.get('status') == '1') { file.element.addClass('file-success'); } els...

4
голосов
9ответов
11570 просмотров

jQuery $.post update not working in IE

I can't get this update script to work in IE. Works fine in every other browser. IE tells me that the update was performed. However, it wasn't. I've no more hair left to pull out..grr. BTW I've tried $.ajax and $.get too..still no luck. I'm thinking it may have something to do with the live c...

2
голосов
2ответов
2059 просмотров

Edit parsed JSON

I have a JSON file contact.txt that has been parsed into an object called JSONObj that is structured like this: [ { "firstName": "John", "lastName": "Smith", "address": { "streetAddress": "21 2nd Street", "city": "New York", "...

1
голосов
1ответов
1702 просмотров

JQuery and JSON

Here's something I want to learn and do. I have a JSON file that contains my product and details (size, color, description). In the website I can't use PHP and MySQL, I can only use Javascript and HTML. Now what I want to happen is using JQuery I can read and write a JSON file (JSON file will ser...

0
голосов
2ответов
2548 просмотров

MySQL hierarchy data to JSON string in PHP

I have data in a MYSQL DB that looks like this: id,parentid,name,count 1,0,top,10 2,1,middle1,5 3,1,middle2,5 4,3,bottom1,3 5,3,bottom2,2 and want to output it via PHP as a heirarchical JSON string where 'top' has a collection of 'middle's etc. Get my drift? Anyone have a recursive PHP functi...

6
голосов
3ответов
5475 просмотров

Help with JSON format

I'm using a JSON example off the web, as seen below. { "menu": "File", "commands": [ { "title": "New", "action":"CreateDoc" }, { "title": "Open", "action": "OpenDoc" }, { "title": "Close", "action...

54
голосов
7ответов
104414 просмотров

Retrieving JSON Object Literal from HttpServletRequest

I am writing code that needs to extract an object literal posted to a servlet. I have studied the API for the HttpServletRequest object, but it is not clear to me how to get the JSON object out of the request since it is not posted from a form element on a web page. Any insight is appreciated. ...

0
голосов
1ответов
205 просмотров

in a javascript object literal, how to reference a function that has the same level or upper level?

as the following code, my question is: in testFunction, how can i call function remove? in remove how can i call testFunction? in remove, how can i call add? great thanks var stringhelper={ testFunction:function(){}, //deal with text such as: //"alignleft red bold header2" classValue:{ //...

0
голосов
1ответов
483 просмотров

Connect.registerUsers - Need helping creating array for accounts param

I keep getting the following error when I try to invoke the Facebook REST API Call: Connect.registerUsers Error Code: 100 - param accounts must be an array JSON based response (from Facebook): {"error_code":100,"error_msg":"param accounts must be an array.","request_args": [{"key":"accounts"...

8
голосов
5ответов
50779 просмотров

Passing Multiple Json Objects as data using jQuery's $.ajax()

I am POSTing data to an MVC controller and I'm attempting to maintain state as well for optimistic concurrency. I'm currently posting back a JSON request, but would be open to workable alternatives? I am already posting a name/value collection with the following command: $.ajax({ url: g_ap...

14
голосов
4ответов
32427 просмотров

JSON object max size?

Using jquery, I'm able to send json objects from client to server using ajax like this: var strJSON = '{"event":[{ "dates":[ "2009-10-14","2009-10-15"], "teams":[ {"id":"0","country":"USA","state":"CA","name":"California Polytechnic State University","subteam":""}, ...

13
голосов
4ответов
2474 просмотров

JS Object this.method() breaks via jQuery

I'm sure there's a simple answer to this, but it's Friday afternoon and I'm tired. :( Not sure how to explain it, so I'll just go ahead and post example code... Here is a simple object: var Bob = { Stuff : '' , init : function() { this.Stuff = arguments[0] } , doSomething :...

4
голосов
2ответов
9501 просмотров

jquery Full Calendar not showing events

I am using asp.net mvc to list the events in the jquery full calendar. Below is the script i am using to list the events through json from mvc. $('#calendar').fullCalendar({ theme: true, editable: true, disableDragging: true, disableResizing: true, header...

7
голосов
2ответов
22322 просмотров

JSON empty string

why does the JSON.stringify-Function converts a string.Empty ("") to a "null"-String? The problem, why i'm not using: JSON.parse(json, function(key, value) { if (typeof value === 'string') { if (value == 'null') return ''; return value; } }); ...is, if someb...

9
голосов
2ответов
9147 просмотров

How can I parse JSON in Perl?

I want to use Perl script that gets the JSON data and converts it into XML file. How can I do that in Perl?

-1
голосов
1ответов
68 просмотров

feed text parser

I'm getting text from an API and it's something like following: text = 'replied to @james and he was visiting this http://some-site.com/another/something/../ so what you think about it'; How can I parse this text and make links as html links and @james as html links also, but with their own hr...

1
голосов
1ответов
5978 просмотров

Android: How to communicate and exchange objects with a Local Service?

So far I've a class for a simple local service. What I want to do is to send requests to this local service from different activies in my application. Depending on the parameters of these requests the service will connect via HttpClient to a webserver and receive a JSONObject and return it to the...

4
голосов
1ответов
3006 просмотров

Parsing JSON in java

I'm trying to parse JSON in android but am having trouble with accessing sub children of an object. I am trying to extract augment from the following, {"augment-list": { "time": "12:01", "channel": "channel1", "augment": [ {"id": "123", "name": "here", "x": "5", "y": "10", "orienta...

1
голосов
1ответов
716 просмотров

Re-populate complex javascript objects from JSON

Say I have a web form that consists of a input text field, an Add button, and a Submit button. A user can add text to a div by typing some input and clicking Add, which will dynamically (using javascript) append the div with whatever they typed. Also during Add, I'm storing the text in a javasc...

0
голосов
2ответов
900 просмотров

Validate/Scrub JSON Data

I am making a web service call and receiving a JSON formatted response. After I receive the response, I would like to display the data in a page. Before I display this data on the page I need to perform checks to make sure that certain elements are defined, and if not give them default values (...

0
голосов
4ответов
340 просмотров

Problems Parsing JSON from PHP

I get a response form my server via AJAX with an array that is json_encode (php funciton). However, I am having difficulty parsing it. I can do this: alert(response); But it just gives me a bunch of text like so: [{"user_id":"Dev_V2_MEH_0910_M03_v03c_NEW_CODE_03"......"grouper_opae_algorithm...

5
голосов
1ответов
11740 просмотров

How to send parameters on an Https POST with C#

I have asked here how to make the https post, and now that works fine. Problem now is How to send a parameter, name query, wich is a json string: {"key1":"value1", "key2":{"key21":"val21"} } What I'm doing and doesn't work is: HttpWebRequest q = (HttpWebRequest)WebRequest.Create(Host + ":" + Port...