json

best way to persist data in .NET Web Service

I have a web service that queries data from this json file, but i don't want the web service to have to access the file every time. I'm thinking that maybe i can store the data somewhere else (maybe in memory) so the web service can just get the data from there the next time it's trying to query the same data. I kinda understand what nee...

Application configuration files

OK, so I don't want to start a holy-war here, but we're in the process of trying to consolidate the way we handle our application configuration files and we're struggling to make a descision on the best approach to take. At the moment, every application we distribute is using it's own ad-hoc configuration files, whether it's property fil...

Are there reasons not to use JSONP for AJA~X requests?

If you're building an AJA~Xy app, are there any downsides to using JSONP requests/responses even if you're not planning on any cross-domain requests? The only thing I can think of is that there are a couple extra bytes for the callback wrapper... Edit: I found this which also suggests security and error handling as potential problems....

Adobe AIR: Handling JSON objects from server

I have a script that retrieves objects from a remote server through an Ajax call. The server returns objects in JSON notation. However, in Adobe AIR, there is a restriction on using eval() for security reasons. So I'm able to get replies from the remote server, but can't turn them back into Javascript objects. Is there any workaround fo...

How to set encoding in .getJSON JQuery

In my web app, i submit some form fields with JQuery $.getJSON() Method. I am having some problems with the encoding. The character-set of my app is charset=ISO-8859-1 but i think this fields are submitted with UTF-8. Does anyone know, how can i set encoding in $.getJSON calls? ...

What PL/SQL Libraries For Auto-Generating JSON Do You Recommend?

Are there any good PL/SQL libraries for JSON that you've worked with and found useful? In PL/SQL, I'm having to tediously hand code the return of JSON values to JavaScript functions. I found one PL/SQL library for auto-generating JSON, but it doesn't do exactly everything I need it too. For example, I couldn't extend the base functions ...

How can I format a javascript date to be serialized by jQuery

I am trying to set a javascript date so that it can be submitted via JSON to a .NET type, but when attempting to do this, jQuery sets the date to a full string, what format does it have to be in to be converted to a .NET type? var regDate = student.RegistrationDate.getMonth() + "/" + student.RegistrationDate.getDate() + "/" + student.Re...

Is there a built in way in .Net AJAX to manually serialize an object to a JSON string?

I've found ScriptingJsonSerializationSection but I'm not sure how to use it. I could write a function to convert the object to a JSON string manually, but since .Net can do it on the fly with the <System.Web.Services.WebMethod()> and <System.Web.Script.Services.ScriptMethod()> attributes so there must be a built-in way that I'm missing. ...

Loading JSON with PHP

I've been using PHP for too long, but I'm new to JavaScript integration in some places. I'm trying to find the fastest way to pass database information into a page where it can be modified and displayed dynamically in JavaScript. Right now, I'm looking at loading a JSON with PHP echo statements because it's fast and effective, but I saw ...

How do I handle newlines in json?

I've generated some JSON and I'm trying to pull it into an object in javascript and I keep getting errors. Here's what I have: var data = '{"count" : 1, "stack" : "sometext\n\n"}'; var dataObj = eval('('+data+')'); This gives me an error: unterminated string literal When I take out the \n after sometext the error goes away. I ca...

Safely turning a JSON string into an object

Given a string of JSON data, how can you safely turn that string into a JavaScript object? Obviously you can do this unsafely with something like... var obj = eval("(" + json + ')'); ...but that leaves us vulnerable to the json string containing other code, which it seems very dangerous to simply eval. ...

Dynamic linq:Creating an extension method that produces JSON result

I'm stuck trying to create a dynamic linq extension method that returns a string in JSON format - I'm using System.Linq.Dynamic and Newtonsoft.Json and I can't get the Linq.Dynamic to parse the "cell=new object[]" part. Perhaps too complex? Any ideas? : static void Main(string[] args) { NorthwindDataContext db = new Nort...

Java Web Services API, however I can't run a JVM on my server

I'm trying to use some data from a PlanPlusOnline account. They only provide a java web services API. The server for the site where the data will be used does not allow me to install Tomcat (edit: or a JVM for that matter). I'm not going to lie, I am a Java software engineer, and I do some web work on the side. I'm not familiar with ...

How to escape XML content with XSL to safely output it as JSON?

How to escape XML content with XSL to safely output it as JSON? ...

How do I expose data in a JSON format through a web service using Rails?

Is there an easy way to return data to web service clients in JSON using Rails? ...

How do I expose data in a JSON format through a web service using Java?

Is there an easy way to return data to web service clients in JSON using java? I'm fine with servlets, spring, etc. ...

Best Way to Organize an ExtJS Project

I've just started developing an ExtJS application that I plan to support with a very lightweight JSON PHP service. Other than that, it will be standalone. My question is, what is the best way to organize the files and classes that will inevitably come into existence? Anyone have any experience with large ExtJS projects (several thousa...

Unable to receive JSON from JQuery ajax call

I have determined that my JSON, coming from the server, is valid (making the ajax call manually), but I would really like to use JQuery. I have also determined that the "post" url, being sent to the server, is correct, using firebug. However, the error callback is still being triggered (parsererror). I also tried datatype: text. Are the...

Deserializing Client-Side AJAX JSON Dates

Given the following JSON Date representation: "\/Date(1221644506800-0700)\/" How do you deserialize this into it's JavaScript Date-type form? I've tried using MS AJAX JavaScrioptSerializer as shown below: Sys.Serialization.JavaScriptSerializer.deserialize("\/Date(1221644506800-0700)\/") However, all I get back is the literal strin...

XML Parser for Javascript

I am looking for a good JavaScript library for parsing XML data. It should be much easier to use than the built-in XML DOM parsers bundled with the browsers. I got spoiled a bit working with JSON and looking forward to something on similar lines for XML. ...