Hi,
I use the protocol jsonp to call web methods, but i have this problem:
Have this code on the webservice:
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
[ScriptMethod]
public string HelloWorld()
{
return "Hello World";
}
}
And this on Jquery with jason on client side:
$.a...
In Scala 2.8 and liftweb.net 2.0 I'm trying to serialize a case-class to Json but when the case class has an enumeration in it it fails.
import net.liftweb.json.DefaultFormats
import net.liftweb.json.Extraction._
import net.liftweb.json.JsonDSL._
import net.liftweb.json.JsonAST.JObject
// Enumerated type
object ColorType extends scal...
Hello guys, I'm using this plugin http://devthought.com/projects/jquery/textboxlist/ to autocomplete like Facebook Style. I'm just a bit confuse on how to return the Json result that fits the plugin's need.
The json result must be like this:
[[1, 'John', null, ''],[2,'Mary', null, ''],[3,'Mark', null, '']]
The problem is when I retur...
What I am trying to do is really simple.
I'd like to convert the following JSON, which I'm getting from an external source:
[{"symbol": "sym1", "description": "desc1"}
{"symbol": "sym1", "description": "desc1"}]
into the following types:
data Symbols = Symbols [Symbol]
type Symbol = (String, String)
I ended up writing the follo...
Hi guys, I am trying to dynamically create two drop down lists, one will be provinces, and the other will contain the cities of each province, so when a user chooses a province, the cities drop down will populate, I am using jQuery's $.ajax funtion to get the data from a database which then passes it back as JSON, here is what I have thu...
Hi guys,
I am trying to create JSON from a comma delimited string, the string look something like this:
One,Two,Three,Four,Five,Six,Seven
I need it to look something like this:
[{"test":"One"},{"test":"Two"},{"test":"Three"},{"test":"Four"},{"test":"Five"},{"test":"Six"},{"test":"Seven"}]
Here is the code I have thus far:
$stri...
Hi guys, I am trying to send a variable with jQuery's getJSON function but it doesn't seem to be going through, I am also unsure of how to get the variable I have just sent in the waiting PHP file, do I just reference it via the name I sent it as, for instance if I send a variable called 'test', can I get it like this, $_POST['test'] on ...
I want to exclude the __type Key and Value from my serialization:
{"__type":"Entity:#Runtime.DataBus","Children":[],"Fields":[{"Key":"field1","Value":"10"},{"Key":"fieldString1","Value":"field1 init"},{"Key":"fieldString2","Value":"field2 init"}],"Name":"Entity1"}
I'm using the System.Runtime.Serialization.Json.DataContractJsonSeriali...
An iphone app we are producing will potentially have a table with 100,000+ records (scaling wise) and I am concerned that loading all this data via a SELECT * command into an array, or an Object will either make the app very slow; or will leave me with memory issues later on.
Obviously loading 100,000+ records into an array when the vie...
Hi I hava a big problem. I have to get some JSON form localhost:8080.
The server side is a restful based jax-rs server.
@Path( "/m" )
public class M {
@GET
@Path( "{id: [a-z]{1,4}-\\d{1,4}}" )
@Produces( "application/json" )
public Response getCar ( @PathParam( "id" ) final String id ) {
final ResponseBuilder builder;
b...
I'm looking for a solution to serialize (and unserialize) Javascript objects to a string across browsers, including members of the object that happen to be functions. A typical object will look like this:
{
color: 'red',
doSomething: function (arg) {
alert('Do someting called with ' + arg);
}
}
doSomething() will only...
I am trying to serialize a Dictionary to JSON, and get the following exception:
new JavaScriptSerializer().Serialize(mydict)
Type 'System.Collections.Generic.Dictionary2[[System.UInt64, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Nullable1[[System.UInt64, mscorlib, Version=2.0.0.0, Culture=neut...
When i get a json feed from a Cyrillic site, the data is in a \ufffd format instead of Cyrillic chars.
(example feed: http://jsonduit.com/v1/f/l/7sg?cb=getJsonP_1284131679846_0)
So when i set the source html to the input, i get weird boxes instead of characters.
I tried to unescape the input but that wont work too.
How do i revert the...
I am using the auto complete plugin by Devbridge and I have it all installed here is my code:
$(document).ready(function(){
$('#request_task').autocomplete({
serviceUrl: '<%= ajax_path %>',
minChars:1,
width: 300,
delimiter: /(,|;)\s*/,
deferRequestBy: 0, //miliseconds
params: { artists: 'Yes' },
...
I've hit a stumbling block and I'm not sure how to proceed. I'm trying to get resque working with redis to go on heroku, I have it all working locally, but when I push to my staging environment and try to queue a job I get the following exception:
TypeError: wrong argument type JSON::Pure::Generator::State (expected Data)
On my local m...
I'm trying to do something rather simple but I'm getting a strange result. I have an event trigger that I'm using to pass a json object but when it gets through to the other side it's a function... I alert the result and it shows this:
example of alert sting:
alert('value of lattitude? ' + map.currentLatLng.lat);
result:
value o...
just curious if there is an alternative solution to the Json.Net library from james newton king
...
So i need this format json and i have this so far
{
query:'Li',
suggestions:['Liberia','Libyan Arab','Liechtenstein','Lithuania'],
data:['LR','LY','LI','LT']
}
query = params[:query]
artists = search_object.map{|x| x["artistName"]}
@all_instances_hash = {}
@all_instances_hash[:query] = query
for instance in artists
@all_...
My MVC web application serves two types of users.
First one over standard web browser
Second one over REST returning only Json data.
Both requires Authentication and authorization.
Both scenarios are differentiated based on the route so that i know what content to serve.
When users access the application, if they are not logIn the appl...
Our web service only supports JSON. We respond with JSON if we can or respond with an HTTP Error 406: Not acceptable if the client asks application/xml... Is it still considered RESTful?
...