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
...
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...
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...
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:...
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...
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...
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 ...
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...
$('.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 "...
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...
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...
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>
</...
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...
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".
...
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...
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&location=ip:94.228.36.39', function(data) {
$('.js...
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.
...
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...
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 ...
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"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
jQuery ....