json

REST - web service response - mime type?

1) Is it important to set the correct mime type for a web service response? 2) what is the correct mime type for a, a) XML response? b) JSON response? application/xml text/xml application/json application/x-javascript text/javascript text/x-javascript text/x-json ...

javascript json - problem decoding ajax json array from php

Hello, I'm using php's json_encode() to convert an array to json which then echo's it and is read from a javascript ajax request. The problem is the echo'd text has unicode characters which the javascript json parse() function doesn't convert to. Example array value is "2\u00000\u00001\u00000\u0000-\u00001\u00000\u0000-\u00000\u00001...

Facebook API and Json with PHP,how to?

Hi friends, https://graph.facebook.com/search?q=India&type=post i am using the above api of Facebook and i am getting following Output { "data": [ { "id": "501585456_163489377008878", "from": { "name": "Ian Robinson", "id": "501585456" }, "message": "\"Media subdu...

Trivial JQuery $.ajax Json Post to ASP.NET MVC2 controller: Cannot get Controller to see JSON (or anything)

I went through dozens of answers to figure out the trick to posting data from $.ajax to a parameter in MVC 2's Controller. Here's as far as I got: BTW this works if you use a GET, but fails as a POST. How would I fix it? $(document).ready(function () { $.ajax({ type: "POST", url: "/Home/Get", data: {value:...

stripped down version of jQuery for ajax/json funtionality

I like Ajax/Json features of jquery but the library is very big for blackberry phone development. Has anyone pulled out or developed a stand alone Ajax/Json library similar to jquery's? I know that a mobile version of jquery is coming, but this looks like it is more directed at GUI for iphone. I also tried XUI, but have been getting ja...

ASP.NET MVC2 and JSON model binding with validation to an action method

Phil Haack's blog entry describes this process using ASP.NET MVC 2's futures and Crockford's json2.js. John Resig also recommends using Crockford's json2.js in this article regarding "use strict";. To get this feature today, would you still download the MVC 2 Futures, or is this included in the MVC 2 final, or is this part of the new M...

json vs big js array

im making a jquery autocomplete, i have something between 10~20k registers the data is static (i'll run a update script when i need) and i can choose to get the file from a json or embed in the page in a single line, like: var title = ["example title 1","example title 2"]; which one should i choose, perfomance wise? (also im worried ...

Understanding Json structure generated by an AJAX-enabled WCF Service

Good afternoon In Visual Studio 2010 I am able to add to my solution a new item called in AJAX-enabled WCF service. That will add a new a .svc file. Later, I have created a method just for debugging purposes: [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allo...

How would I modify my jQuery ajax response to do the same thing with JSON that it currently does by returning JavaScript?

$('.showprayer').click( function(event) { $.post('/show_prayer', { 'name' : $(this).text() }, function(data) { eval(data); }); }); The jQuery function above returns the following string as the ajax response coming back from the server: '#prayer_date'.html("03/19/1968"); Someone seeing this code earlier responded that "...

How to use jquery selectors on json result

Hi all, I'm creating an inbox system for my website which allows basic communication between users. I'm fetching the results with jquery calling a webservice. Then I'm using a jquery template engine to render the results to the screen. So far this all works good. but now I want to add some click functions on certain parts of inbox mess...

JSONP not receiving any callback?

Trying to make a JSONP request to yellowapi (Yellow Pages), even specifying a callback is giving me the "invalid label" error. Here is what I have so far: $.ajax({ dataType: 'jsonp', cache : false, url: "http://api.sandbox.yellowapi.com/FindBusiness/", data : "apikey="+testingPurposes+"&what="+what+"&where="+where+" &fmt=JSON&pg...

How to load data using jquery and json?

Hi i want to load data from mysql database to php page using jquery and json. When user choose the name from select box, it load the person data into the text field. this is my html code (select) <select name='name' id='name'> <option value='1'>John</option> <option value='2'>Marco</option> <option value='3'>Charles</option> </...

Problem displaying json file

I am trying to display these arrays using jquery/json but i keep getting undefined. Also, how can i display is without the user clicking "A" ? thanks in advance == jSON file == // JSON { "items": [ { "title": "welcoem home", "author": "Charles Dickens" }, { "title": "Harry Potter", "author": "J rowling" } ] } == <script language="j...

how to change page content type at runtime in MVC?

hi, I am working in asp.net MVC & on the view has to show both json & xml content depending on some condition. I have to change the content type of the page at runtime ie, if the condition for json is fulfilled then set page contenttype = "text/json" & if the condition for xml is fulfilled then set page contenttype = "text/xml". ...

Browser download dialog box

I want to open up browser dialog box when user click a button, and afaik this can be done by using a FORM tag. The problem is the server only accepts json data (and using the form tag it has to have a name i.e. formdata={"key":"value"} The server does not like this format as it expects pure JSON {"key":"value"} Is there a wa...

Parsing JSON with jQuery

Hey. I am trying to parse some JSON into HTML using jQuery. I’ve checked to see if my API request is working, and it is. I think it gets stuck when appending the HTML. $('button').click(function(){ $.getJSON('http://api.songkick.com/api/3.0/events.json?apikey=MY_API_KEY&amp;location=ip:94.228.36.39', function(data) { $('.js...

Why does Perl's JSON module not read or write files?

Am I missing anything, or does JSON lacks a write_to_file() and read_from_file() subroutines? Obviously, I can easily implement them, but as they seem so handy I wonder how can it be they are not there. ...

jQuery datepicker, disable dates from MYSQL

I have a list of dates stored in a MYSQL table, the idea is if the following field has valued 'completed' the row's date is unselectable in the jQueryUI datepicker. The dates are stored in the format YYYY-MM-DD.. how would I go about loading these 'completed' dates into a PHP array in a format for the datepicker to understand and disable...

Garbage after JSON - PHP Array problem YQL

Hi, i'm using YQL to send data back to an iPhone app i'm developing. I've got a JSON parser on the iphone and a PHP page on my webhost. This is the PHP: <?php header('Content-type: application/json'); $arr = array(); $result = $_GET["q"]; $yql_base_url = "http://query.yahooapis.com/v1/public/yql"; $yql_query = "select * from ...

How to dynamically add an option to a select list that is build using json data retrieved from a php script?

I have an HTML form that builds a drop-down from json data that is retrieved dynamically on page load from a php script. <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt; <script type="text/javascript" language="javascript"> $(document).ready(function() { jQuery ....