I have a page that's working fine in Firefox 3.5.6 but not in IE 7 or Opera 10.01
I'm including the minified version of JSON2.js from json.org in a script tag in the head section.
In Firefox the data gets parsed into an object. Opera and IE both throw errors, saying they can't find the JSON object.
How can I fix my javascript so that ...
Hi,
I'm looking for the best way to stream live data over the http protocol with java.
I'm currently using HttpURLConnection to receive json feeds, I would like to know if it can be used to stream feeds too.
...
Getting single key from Value
I would like to do a backwards selection from the following JSON. I'd like to extract the abbreviation for a particular state. In this situation, the abbreviation is the key, and the value that I'm starting with is the value.
Certainly I can loop through each value, comparing the value to my value, and sel...
How can i turn this:
<? echo json_encode($myArrays); ?>
...into this:
_rowData: [
{ name: "Most Recent", view: "recentView" },
{ name: "Most Popular", view: "popularView" },
{ name: "Staff Picks", view: "staffView" }
],
My script returns that ^, but i dont know how to put the data into the string, _rowData ?
P.S. I am...
my JSON objects look like this:
[{"aid":"1","atitle":"Ameya R. Kadam"},{"aid":"2","atitle":"Amritpal Singh"},{"aid":"3","atitle":"Anwar Syed"},{"aid":"4","atitle":"Aratrika"},{"aid":"5","atitle":"Bharti Nagpal"}]
As you can see the names are differentiated through their associated aid's. Now suppose I want to display the name stacked ...
my JSON array is like this;
var foo = [{"aid":"1","atitle":"Ameya R. Kadam"},{"aid":"2","atitle":"Amritpal Singh"},{"aid":"3","atitle":"Anwar Syed"},{"aid":"4","atitle":"Aratrika"},{"aid":"5","atitle":"Bharti Nagpal"}]
if i select any element, for example,
alert(foo[0].atitle);
output: Ameya R. Kadam
the first element's atitle val...
I have this code converting a mysql query to json:
$sth = mysql_query('SELECT * FROM `staff` ORDER BY `id` DESC LIMIT 20') or die(mysql_error());
$rows = array();
while($r = mysql_fetch_array($sth)) {
$rows[] = $r;
}
print json_encode($rows);
Works great, but i have in my database, a url field, here is a sample json row:
{"0":"4"...
For some reason the item "description" returns null with the following code:
<?php
include('db.php');
$result = mysql_query('SELECT * FROM `staff` ORDER BY `id` DESC LIMIT 2') or die(mysql_error());
$rows = array();
while($row = mysql_fetch_assoc($result)){
$rows[] = $row;
}
echo json_encode($rows);
?>
Here is the schema for my ...
I'm trying to parse bit.ly JSON reply in javscript.
I get the JSON vis XmlHttpRequest.
var req = new XMLHttpRequest;
req.overrideMimeType("application/json");
req.open('GET', BITLY_CREATE_API + encodeURIComponent(url) + BITLY_API_LOGIN, true);
var target = this;
req.onload = function() {target.parseJSON(req, url)};
req.send(null);
pa...
I want to post the Form but don't want to use the Submit method. If I use JQuery, how to handle the Form input controls?
...
I know very little (none) JavaScript, or much about using API's. However I would like to display some hotel reviews on my webiste made available over the qype.com API. However I'm struggling with being able to manage this.
This is the code I have so far:
$(document).ready( function() {
$.getJSON( "http://api.yelp.com/business_revie...
I have a lot of JSON data I need to pass to a request:
$.ajax({
type: "POST",
url: "http://"+HOST+"/users/rankings",
data: "friends="+JSON.stringify(friendsArr),
success: function(response){
$("#rankings").html(response);
}
})...
I have a web page where I want to display hotel reviews from the yelp.com API for a number of hotels.
I have managed to do this for one hotel, and it works perfectly displaying the data under that specific hotel's details on the page. However, how can I now multiply this process so that I have separate reviews for each hotel?
My web p...
There appears to be at least three different libraries for extracting JSON data from an HTTP request.
TouchJSON (http://code.google.com/p/touchcode/)
BSJSONAdditions (listed at json.org - http://blakeseely.com/blog/archives/2006/03/29/bsjsonadditions-12/
json-framework (http://code.google.com/p/json-framework/)
Any reason I would sel...
I've started the following skeleton for an ajax/post/update function I'm wanting to write in javascript (using jquery):
$.post("/gallery/resize",
function (data) {
alert(data);
alert(data.complete);
if (data.complete) {
alert("done");
} else {
alert("blah");
}
},
"json"
);
And the response script ...
Hello,
I am trying to get the realtime stockquotes from google for some time now.
First I try'd the finance api, but that didd'nt work out.
Then I saw this query and it seems to good to be true
http://www.google.com/finance/info?client=ig&q=goog
It must have some drawbacks that I am not aware off now.
Anyway, it does give realt...
Hello,
Can anyone help me with this one
I have this query and only after adding the last one wich is indexed against the euro
I get invalid json.
$url = 'http://www.google.com/finance/info?client=ig&q=goog,yhoo,AMS:TOM2';
$response= json_decode($response,true);
The only thing different if I directly echo the output is the quest...
So I have this JSON, which then my activity retrieves to a string:
{"popular":
{"authors_last_month": [
{
"url":"http://activeden.net/user/OXYLUS",
"item":"OXYLUS",
"sales":"1148",
"image":"http://s3.envato.com/files/15599.jpg"
},
{
"url":...
I've got the following JSON structure that defines a table and it's data.
var arrTable =
[{"table": "tblConfig",
"def":
[{"column": "Property", "type": "TEXT NOT NULL"},
{"column": "Value", "type": "TEXT NOT NULL"}],
"data":
[{"Property": "VersionNumber", "Value": "1.0"},
{"Property": "ReleaseDate", "Value...