json

PHP Checkbox Array

All, When a form gets posted, I get some checkbox values like the below: [chk0] => Array ( [1] => on [57] => on [83] => on ) [chk1] => Array ( [69] => on [71] => on ) [chk1001] => on [chk1005] => on [chk1008] => on Using PHP,How can I construct a JSON request with 2 arrays like this by using the ab...

sending json data to server

I have this code to send data: function insert_new_image() { var ids = []; $('.be-imagecontainer').each(function(i){ ids[i] =$(this).find('span').text(); }); var jsonids = {'ids' : ids} var url = base_url + 'ajax/get_new_images'; $.ajax({ url : url, data : {'ids' : jsonids}, suc...

getJson method Call

Hi, I am using the below method between the 50lines of JQuery Code. From the Json Result, I have to do the Further process. What it does is, When first time it is not calling the specified url and debuuger not hit inside to the JSon. After all the below code runs then, It fetches the result and debugger(inside Json Method) is also hit....

jquery not updating DOM after $.getJSON in IE/Internet Explorer

I have a page that contains an element, <displayedimage>, that is not getting updated using jquery's document.ready/$.getJSON funcitonality in IE 6 and IE 8 (probably IE 7 too even though I haven't tested). This same piece of funcitonality works fine on XP Safari and OS X Safari, OS X Chrome, OS X Opera, etc. So, here's what happens: I ...

Validate JSON object using a Schema Definition

Just we can validate an incomeing XML file based on the pre-defined schema, i.e. XSD or DTD, can we performation a validtaion on an incoming JSON object. Is there any JSON Schema Definition available? ...

Retreiving names of high level JSON arrays with jQuery/JS

I am working with JSON data with multiple sets of key value pairs - each set constitutes a list. In the simplified example below, The list name is not known beforehand - actually I'll need to populate a select dropdown on the page with the names of each list. How do I retrieve the set names in this situation? Thanks ({ "list1": [{ ...

jQuery - $.each loop through variable object

I'm working with a JSON dataset that has multiple high level objects. If I literally declare the object name, I can loop through the JSON with no trouble, but when I use a variable in its place, I get errors. It appears that it's trying to apply the variable name as the literal name of the object. Here's a quick example function(data){ ...

Processing JSON in asp.net web form

So I'm sending an HTTPWebRequest to a service and they are returning a userid in JSON. They are returning: {"id: 123456"} How do I process this? Should I just do a split on the " : " and take the second element or is there a proper way of doing this? Thanks guys. ...

How can I make a database driven list/feed that can be updated with jQuery ajax?

I'm wanting to know what the best way to go about creating a list of say, users's statuses (similar to what facebook/twitter has) that is loaded in with PHP when the page loads. But ajax checks for new status updates every 10 seconds or so. It looks like to me that there are about 2 options: Put the "new items" html in the PHP file th...

Using CouchDB to serve HTML.

I'm trying to use CouchDB with HTML/standalone REST architecture. That is, no other app server other than CouchDB and ajax style javascript calling CouchDB. It looks like cross scripting is a problem. I was using Cloudkit/Tokyo Cabinet before and it seems like the needed callback function was screwing it up in the URL. Now I'm trying ...

Is there an ASP.NET MVC controller that can auto-handle JSON/XML/Views?

Is there an ASP.NET MVC controller or helper class that can automatically return the proper HTTP response based on the HTTP request header? I'd like it to be able to return JSON, XML, or a View based on the request's content type, with the only thing I have to do is populate some global Model object with data from the database. ...

what is the best way to find some items in an array based on the item property value?

I have an array like this: var anArray = [ { name: "scala", type: "a" }, { name: "abc", type: "b" }, { name: "test", type: "a" }, { name: "ruby", type: "c" }, { name: "erlang", type: "a" }, ]; I want to find items based on the item property. I currently do it using jQuery. something like this; Array.protot...

JSon and objective-c

Hello! I want to use the JSon library in my iPhone project, and went to this site: JSON And there I choosed the Cocoa JSON Framework, but the site don't want to load for me. Any ideas how to fix this problem? Or suggestions for a place where I can get the JSon for objective-c? ...

[php] return json string with html characters?

i want to call a php with jquery ajax to perform some database things and then return 2 lists of links. so i have to pass these two link lists back to jquery so it can display list 1 in the left side of the webpage and list 2 in the right side. i created the lists in separate arrays that i send back to jquery with json_encode but i noti...

Is it possible to delete an entry from a JavaScript array?

Hi all, Is it possible to delete an entry from a JavaScript array? The entry in the list gets replaced with null when delete operator is used. data = [{pid:30, pname:abc}, {pid:31, pname:def}, {pid:32, pname:zxc}] delete data[1] becomes: data = [{pid:30, pname:abc}, null, {pid:32, pname:zxc}] FYI I'm getting this as json back from...

Which .NET JSON serializers can deal with NHibernate proxy objects?

Which .NET JSON serializers can deal with NHibernate proxy objects? I tried using JSON.NET but it craps out when it hits a proxied object. ...

generate multi-dimentional JSON array from PHP/MySQL

I want to create a JSON object that looks like the example below. { "Products": [ { "ProductNo": "11111", "Descr": "Myproduct-1", "Price": "225.36" }, { "ProductNo": "11112", "Descr": "Myproduct-2", "Price": "235.46" }, ...

Json isn't returning a result that is accessible as an array...

I'm having troubles reading a Json result back from a controller method... I have this method in my controller: [AcceptVerbs(HttpVerbs.Post)] public JsonResult GetCurrent() { IList<string> profile = new List<string>(); profile.Add("-1"); profile.Add("Test"); profile.Add(""); return t...

Serializing a hierarchy of plain C# objects to a JSON array.

I have a class structure in C#, similar to the following: [DataContract] class Data { [DataMember] public List<Hotel> Hotels { get; set; } // etc... } [DataContract] class Hotel { [DataMember] public int HotelID { get; set; } [DataMember] public string HotelName { get; set; } // etc... } I've been serializing this...

dijit Form toJson returns empty object for dijit.form.DateTextBox

Running the following code: dojo.toJson(formSearch.attr("value")); Appears to not serialize the value of dijit.form.DateTextBox controls. Looking in Firebug, I can see that formSearch.attr("value")) returns the appropriate DOM object that contains the value that the control is set to, but when I try to serialize it, I get something l...