I have a simple web service with a web method that creates a list of objects..
public string GetPersonList()
{
Person p1 = new Person { Name = "Rich", Age = "33" };
Person p2 = new Person { Name = "Rebekah", Age = "34" };
Person p3 = new Person { Name = "John", Age = "20" };
List<Person> p = new List<Person>...
I want to inject some Json into the Html page returned by the server?
Is there a public function that returns the Json string when Json(someObject) gets called?
Note that I don't want to return Json to the browser in a seperate request. I want to convert an object graph to json and inject it into a script block.
Thanks
...
Note: This is a long winded question and requires a good understanding of the MVVM "design pattern", JSON and jQuery....
So I have a theory/claim that MVVM in DHTML is possible and viable and want to know if you agree/disagree with me and why. Implementing MVVM in DHTML revolves around using ajax calls to a server entity that returns J...
Hi everybody,
I think this is a simple issue I just haven't worked with JSON like this before.
Very simply, I have a JSON object:
fc_json = {
"product_count": 1,
"total_price": 199.95,
"total_weight": 1,
"session_id": "26e8og4ldmlunj84uqf04l8l25",
"custom_fields":{
"affiliateID":"25"
},
"messages":{
"errors":[],
...
I'm trying to write an OpenSearch Suggestion service that complies with the OpenSearch spec.
http://www.opensearch.org/Specifications/OpenSearch/Extensions/Suggestions
This spec requires the service to return a JSON array with the first element being a string and the following elements being arrays of strings. I'm able to get it almo...
I am trying to use google translate from python with utf-8 text.
How do I call the json api? They have a document for embedding it in html but I can't find a proper API or wsdl anywhere.
Thanks
Raphael
...
$(document).ready(function() {
$('form#search').bind("submit", function(e){
e.preventDefault();
$('#content').html('');
var query1 = urlencode($('input[name="user_a"]').val()); //userA
$.getJSON('http://twitterank.com/...
Hi everyone,
does someone know a JSONQuery parser in Java?
Thanks a lot in advance!
-- Andreas
...
Hi, I'm trying to use the PHP json_encode function to encode some JSON to send along to a jQuery plugin that will render out a calendar. The plugin's name is FullCalendar.
I've started on grabbing event data from a MySQL database and encoding it in a JSON string, but I've run into a problem. The default JSON example that comes with the...
I have an existing web service that returns XML responses and I would like to add some new methods that return JSON. Do I have to create a separate web service that returns in JSON or can I have a mix?
If I use the ResponseFormat = WebMessageFormat.JSON I need to have the service annotated with [DataContractFormat] but I cant seem to ha...
I am doing an MVC with C# application. I was trying to access the entire row in a table and change the values in each cell using jquery.
I need to do change the value in each td once a json call is succeeded.
Please advice for this
...
Not strictly a programming topic but input is appreciated. I've been developing a lot lately with YouTube APIs and I started with PHP code, using SimpleXML, then actually skipped AJAX and went straight to using native JSON and doing everything client-side.
While it "feels" faster, I wonder if it's ready for primetime yet. Even with t...
We've got a couple of Django flatpages in our project, that are based on actual HTML files. These files undergo some changes once in a while and hence have to updated in the database. So i came up with the idea of simply copying the plain HTML text into a json fixture and do an manage.py loaddata .
However the problem is, that there are ...
From a security perspective, I can see simply doing an 'eval' on incoming JSON data as a critical mistake. If you got data like below you'd have some problems.
{ someData:((function() {
alert("i'm in ur code hackin' ur page");
})()) }
I wondered what do most popular Javascript libraries do? Is it a manual parse or simply an eval...
I want to read the content from an external page, convert that into a predefined format, and then enter it into a database.
This is just for fun--it's taking an event list and copying the events to my own site.
Take this page, and manipulate it to fit a different format...
Is it possible to do this with jquery?
...
In Javascript, what is the difference between an object and a hash? How do you create one vs the other, and why would you care? Is there a difference between the following code examples?
var kid = {
name: "juni",
age: 1
}
And:
var kid = new Object();
kid.name = "juni";
kid.age = 1;
And:
var kid = new Object();
kid["name"] = "jun...
I am fetching a .js file from a remote site that contains data I want to process as JSON using the simplejson library on my Google App Engine site. The .js file looks like this:
var txns = [
{ apples: '100', oranges: '20', type: 'SELL'},
{ apples: '200', oranges: '10', type: 'BUY'}]
I have no control over the format of this ...
I am attempting to parse a JSON feed from Yahoo Pipes to turn it into XML, using YQL. My query is:
"select * from json where url='http://pipes.yahoo.com/pipes/pipe.run?_id=[pipe-id]&_render=json'"
The problem is that the original Pipe was parsing an RSS feed, filled with dublin core tags (example: dc:title, dc:source, etc). The XML...
I need to pull back from a database JSON documents that are not based on a standard object.
Is there a way using .NET to "deserialize" these documents into Lists & Dictionaries of primitive objects (string, int, bool, etc...)
Any library that can do this in both directions?
...
I'm working on a project which uses Jersey to convert objects to JSON. I'd like to be able to write out nested lists, like so:
{"data":[["one", "two", "three"], ["a", "b", "c"]]}
The object I'd like to convert first represented data as a <LinkedList<LinkedList<String>>>, and I figured Jersey would just do the right thing. The above wa...