json

MVC2 JSON input

I have a problem with a simple VS2010 .NET 4.0 MVC2 application. My controller action looks like this: public JsonResult GetJson(string query) I access the action with jQuery like so: function getJson() { var postdata = {}; postdata['query'] = $('#query').val(); $.ajax({ type: "POST", url: '<%= Url.Acti...

Send JSON from Flash to PHP

Hi, I'm trying to send array of data from Flash to PHP to sending e-mail. I'd like to do that because I must change the php page everytime my form site changes because of client's choice. My answer is, can I send an array of objects like this to php? var message:Array = new Array (); message.push ({field_name:"Name", value:"John Lennon...

Passing a JSON object to a function on server side, I get only [object Object]

I'm trying to create a JSON object on client-side and pass to a server-side function. Then instantiate it on server-side using JSON string representation. So I create jSON object on client-side var myJsonObject = { "arg1": var1, "arg2": var2 } and pass it in to WebForm_DoCallback(controlID, myJsonObject , n...

Consuming a ASP.NET MVC 2 JsonResult like a web service in a web forms C# application?

A friend wants to consume my ASP.NET MVC 2 application in a similar fashion as adding a web reference to it, accessing my functions, and using my model objects from a .Net web form from a separate website. Any links out there that could explain how to "dress" my MVC responses so that his server to server consumption would be similar in ...

I'm getting an error when trying to open a website url with Python 3.1, urllib & json: operation was attempted on something that is not a socket

I'm getting an error when trying to open a website url with Python 3.1, urllib & json urllib.error.URLError: Here's the code. The first website loads fine. The second one import json import urllib.request import urllib.parse import util # This one works fine response = urllib.request.urlopen('http://python.org/') html = response....

How to convert a jquery object to JSON string OR how to save a specific element in a string?

I added a click event to all elements on the page and now want to send the clicked target element to a server. If the clicked element has an ID, then I can just send the ID, but if the element doesn't have an ID, class, name, ... , then how can I send an identifier (or selector) to the server which points to this exact element? I tried ...

Can I use a JSON array as a small database?

I'm retreiving a JSON string and parsing it with jQuery with $.getJSON. After I get the data in a variable, can I add or remove rows? An example: {"one": [{"sid":"1","name":"NAME 1"},{"sid":"2","name":"NAME 2"}], "two": [{"sid":"3","name":"NAME 3"}]} Can I delete sid 1 from "one" and place it in "two"? How about sorting by sid? I'm ...

How to convert datatable to json string using json.net?

How to convert datatable to json using json.net? Any suggestion... I ve downloaded the necessary binaries... Which class should i use to get the conversion of my datatable to json? Thus far used this method to get json string by passing my datatable... public string GetJSONString(DataTable table) { StringBuilder headStrBuild...

JSON parser for J2ME

I need a basic JSON parser that works with J2ME / CLDC 1.1. A Google search returns tons of answers on this (some even on stackoverflow), but it appears that all point to libraries and solutions that are no longer available (for example, lots point to an implementation that is supposed to be on the json.org site, but at least I can't fi...

Jackson - suppressing serialization(write) of properties dynamically

I am trying to convert java object to JSON object in Tomcat/jersey using Jackson. And want to suppress serialization(write) of certain properties dynamically. I can use JsonIgnore, but I want to make the ignore decision at runtime. Any ideas?? So as an example below, I want to suppress "id" field when i serialize the User object to JSO...

Securing an AJAX API to prevent other sites from taking advantage of it

We're currently developing a site that uses a simple JSON API (RoR) to populate the page. The data is public to clients but key to our service and we want to make sure that our competitors aren't leeching our data. What methods do you use to verify that AJAX requests to an API are legitimate? ...

See anything wrong with this JSON2 push/stringify?

dynamictextareas.push({guideid:targeteditorID, guideitemtext : textareacontents }); alert( JSON.stringify(dynamictextareas) ); See anything wrong with this JSON2 javascript code? For some reason this come is making a mess of things. I want to push: <p>DDDDDD</p> But instead it's pushing: [{"guideid":"1","guideitemtext":"<p>\u000a...

Imitate Google suggest with AJAX and PHP

I want to imitate Google suggest with the following code, which means: step 1: When user types in search box, the query string will be processed by a server php file and query suggestion string is returned(using Ajax object). step 2:When user clicks on a query suggestion, it will fill into the search box (autocomplete). Step 1 is a...

Android compatibility with Restlet/JSON/Jackson

I'm currently working on a webservice-client for Android. I'm using a Java client library which provides an abstraction for interaction with the service. The client library works on normal machines. However, when I use the classes in my Android project, some calls don't return a result on Android, the background-service stops working at ...

How do I make a third party .jar available to my .jsp page?

I'm just starting to learn JSP (and I'm pretty new to Java in general), and I'd like to use JSON-lib with it. I want to make a page something like this: <%@ page import="net.sf.json.JSONObject"%> <% String json = new JSONObject().put("hello", "world").toString(); out.println(json); %> I downloaded json-lib-2.3-jdk15.jar and put it in ...

using variable in DATA of getJASON Callback function

Hi, My problem is manage the code which get the tag and use is as variable (var searchterm= ??????). With JSON I want first get the "location" tags with tagthe and show the relate photos from flickr. <!DOCTYPE html> <html> <head> <style>img{ height: 100px; float: left; }</style> <script src="http://code.jquery.com/jquery-latest.mi...

Railroad diagrams - what do the double bars on the ends mean?

In the json site, the number and string diagrams are book-ended by double bars. What do the double bars mean? ...

How Can I Use This JSON data like array

hi, I have json data like this: {"Adobe Photoshop":"70","Adobe Premier":"71","Animasyon":"72","AutoCAD":"73","Bro\u015f\u00fcr & Bilet":"75","CorelDraw":"76","Flash":"77","Grafik Tasar\u0131m":"68","Karikat\u00fcr":"78","Kartvizit Tasar\u0131m":"79","Logo Tasar\u0131m":"80","Poster":"81","Reklam Tasar\u0131m":"74","Ses D\u00fczenleme":"...

Returning PHP Multi-Dimension Array to Javascript/AJAX

My understanding is that in order to return a complex PHP variable to Javascript, it should be done via AJAX and json_encode. Could somebody give me an actual example (both PHP and Javascript code) of this? Lets say we have the two-dim array in PHP: $twoDArr = array( array('Greg', 44, 'Owner'), array('Joe', 23, 'Rent...

json parser empty result

I'm new in gwt and new to using Firebug. MY gwt version is 2.0.0. using eclipse and WAMP. my IIS is stoped to run WAMP apache. I run my program on firefox I have valid json result from tesdb3.php located in "http://localhost/phpmyadmin/tesdb3/datauser.php" {"item": [{"kode":"002","nama":"bambang gentolet"}, {"kode":"012","nama...