json

updating images in a ul list via jquery ajax

I have the following jquery code: jQuery(function(){ jQuery("select#rooms").change(function(){ var options = ''; jQuery.getJSON("/admin/selection.php",{id: jQuery(this).val(), ajax: 'true'}, function(j){ for (var i = 0; i < j.length; i++) { //what should go here? } }) }) }) from the serve...

Convert a JSON string to object in J2ME?

I've asked this before for Java, but this applies specifically to J2ME. Is there a way in J2ME to convert a string, such as: {"name":"MyNode", "width":200, "height":100} to an internal Object representation of the same, in one line of code? The problem with such JSON libraries, is that they generate JSONObjects from strings, not...

A free xml/json whois service?

Is there any free xml/json whois service for unlimited queries? ...

Defining recrussive JSON Object notation

Whats wrong in below JSON Object definition I am trying to create a new JSON Object like below. So that my idea is to access COMPANYSETUP.HourSetup.initiate(); Not sure the error ? COMPANYSETUP = { initiated : false, companyId : "", initiate : function() { if(!initiated)...

Is there a good MooTools data grid that supports JSON and XML?

I'm looking for a MooTools based data grid that supports JSON and XML data types. If anyone could direct me to one, and identify a few key points why they would select it, I would appreciate it. ...

Forcing ASP.net webservice to return JSON

I have an ASP.net web service that I'm using for a web application which returns a either XML or JSON data to me, depending on the function I call. This has been working well thus far, but I've run into a problem. I want to create an "export" link on my page that will download a JSON file. The link is formatted very simply: <a href="myw...

How do you encode an Object in a Web Worker for it to be passed via postMessage?

Internally, Firefox will JSON encode an object passed via postMessage to and from the Web Worker. However, this only works in Trunk builds of Firefox (3.6+) and not in Firefox 3.5, so the question is really how to add backwards support of this operation to the current platform. The window.atob() and window.btoa() methods had been suggest...

Need Help on Looping Through Deserialized Custom Class

I am having a hard time figuring out how to expose (& loop through) the properties of my Categories class which was serialized (using JSON) in a WCF service and deserialized on the server as illustrated below. JavaScriptSerializer serializer = new JavaScriptSerializer(); Category cat = serializer.Deserialize<Category>(param1); // M...

Rails: do we have anything built-in to output a ruby array as arguments to a javascript function call?

Hi, Here's what I want, in wishful code: in my controller action: @javascript_function_args = [ "foo", "bar", 1, [2, 3], { :zort => 'narf', :nom => 'cake' }] in my erb view: <script … > performAwesome(<%= @javascript_function_args.to_js_args %>); </script> or, even better: <%= call_javascript_function :performAwesome, *@java...

jQuery AJAX polling for JSON response, handling based on AJAX result or JSON content

I'm a novice-to-intermediate JavaScript/jQuery programmer, so concrete/executable examples would be very much appreciated. My project requires using AJAX to poll a URL that returns JSON containing either content to be added to the DOM, or a message { "status" : "pending" } that indicates that the backend is still working on generating a...

copy XML using XSLT into JSON

Hello, I would like to copy XML using XSLT into JSON. The JSON result would look like this: callback( {"xml":" <?xml version="1.0" encoding="UTF-8"?> <root> ... </root> "}) and my XSLT so far: <xsl:template match="/"> <xsl:text>callback( {"xml":"</xsl:text> <xsl:copy-of select="*"/> <xsl:text>"} )</xsl:text> <...

Can you tell me a good Java Date formatter to parse a Javascript Date object?

Hi, clientside I have some scripts that send to the server some strings... one of which comes from a Javascript Date object. Now, it has it own formatting and I was just wandering if is there a class that does the right conversion, as I am experiencing problems with SimpleDateFormatter... ...

Ignoring a field during .NET JSON serialization; similar to [XmlIgnore]?

I have a POCO class that is being sent to the browser as a JSON string in .NET 3.5 sp1. I am just using the default JSON serialization and I have some fields that I want to ignore. I want to put an attribute similar to [System.Xml.Serialization.XmlIgnore] on them so that they are not serialized. ...

AJAX polling of a URL returning JSON doesn't seem to return fresh responses (using jQuery $.ajax() method)

My project requires polling a certain URL for a JSON response, using AJAX. The first AJAX request that I make alerts the server that I want some JSON content, and it begins building and cacheing a response, sending me back { "status" : "pending" } for each subsequent AJAX request until the JSON is ready. At that point, the response chang...

Trying to access JSON menu in another function to build out a left side navigation

Hi All. I am relatively new to Jquery and JSON and this is my first post here, please bear with me. I have a JSON menu string with an array of three items (name, url, id - our internal page id number) and the top level navigation builds out fine. I loop through the top level items and call a recursive function to get the sub menus. ...

html tags in data returned from json

I have a php page that is returning some data in json. Basically I am doing echo on this page. The data being returned has some html tags. This is causing my jQuery code to break. Is there a way to clean up the data and strip off the tags before putting it in the json object? Furthermore, I am trying to display the data from json in...

Passing Array using GET with PHP/jQuery

Hello, I'm currently using $.getJSON to pass an array of ids. It basically constructs a URL like this: http://domain.com/json.php?id=1&amp;id=2&amp;id=4 My question is: How can I take these ids that are passed (1,2,4) and place them in my where clause? Something like: $id = $_GET['id']; $sql = SELECT * FROM table WHERE usrID ...

json messing up when data returned has html tags

I have a php page that is returning a json object like this: header('Content-Type:application/json'); echo <<<HERE_DOC [ {content: '{row2[contentFull]}', bigimages: '{$row3['catalogFileID']}'}] HERE_DOC; } In my main page I have the following jQuery code: jQuery(function(){ jQuery("select#rooms").change(function(){ var optio...

$getJSON not being recognized as an array

Hello, I'm trying to use jQuery's $getJSON to send an array of 'ids'. Here's what my jQuery looks like: var calendarIds = []; $("#jammer :selected").each(function(i, selected){ calendarIds[i] = $(selected).val(); }); $.getJSON("test.php", { start: start.getTime() / 1000, end: end.getTime() / 1000, calendarid:...

JSON result containing only one item

I'm likely missing something with json and javascript. [{"commentText":"Testing 123","userPosted":"maxfridbe"}, {"commentText":"Testing 23","userPosted":"maxfridbe"}] Sometimes I get multiple responses which works with this code: function(data) { var sel = this; jQuery.each(data, fun...