json

Processing JSON data with jQuery - strange results needing alert()

I have this code below. I randomly ran across that it will work if I have that alert message exactly where it is. If I take it out or move it to any other spot the tabs will not appear. What exactly is that alert doing that allows the code to work and how can I make it work without the alert? $.ajax({ type: "GET", url: "../aj...

How to send a JSON object over Request with Android?

Hi, I want to send the following JSON text {"Email":"[email protected]","Password":"123456"} to a web service and read the response. I know to how to read JSON. The problem is that the above jason object must be sent in a variable name jason. How can i do this from android? Like creating a request object setting content headers etc. ...

can't get the twitter status updates from jQuery

why is the code below showing 'got the result null' alertbox ? while the request seems to be sending a proper json. $(function(){ $.getJSON('http://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitterusername', function(data) { alert('got the result '+data); }); }); ...

Twitter json output

$(function(){ $.ajax({ url:'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=user_name&callback=?', //dataType:'json', success:function(data){$('body').append('the data is' +data);} }); }); the above code with dataType line prints ou...

mySql table returning JSON that needs formatting for a iPhone UITableview

I have a php query the returns the following JSON format from a table. [{"memberid":"18", "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School", }, It needs the following format: [{"memberid":"18" { "useridFK":"30", "loginName":"Johnson", "na...

How to preserve the state of JavaScript closure?

I am working on a migration platform to migrate web applications from a device to another. I am extending it to add the support for preserving JavaScript state. My main task is to create a file representing the current state of the executing application, to transmit it to another device and to reload the state in the destination device....

JSON or YAML encoding in GWT/Java on both client and server

I'm looking for a super simple JSON or YAML library (not particularly bothered which one) written in Java, and can be used in both GWT on the client, and in its original Java form on the server. What I'm trying to do is this: I have my models, which are shared between the client and the server, and these are the primary source of data i...

Jquery each loop with json array

I'm trying to use Jquery's each loop to go through this JSON and add it to a div named #contentHere. The Json is as follows: { "justIn": [ { "textId": "123", "text": "Hello", "textType": "Greeting" }, { "textId": "514", "text":"What's up?", "textType": "Question" }, { "textId": "122", "text":"Come over here", "textType": "Order" }...

cant read the json fom yahoo pipe.

$(function(){ $.getJSON('http://pipes.yahoo.com/pipes/pipe.run?_id=7ba696f34ae17b6fa8f5d4de13064dea&_render=json&callback=?',function(data){alert('called')}); }); i am using the above code to acess the a yahoo pipe i created to convert the last.fm xml output to json.but the firebug console output is sho...

What sort of object is this and how to use it?

What would be the correct name for this type of array? There are 3 main sections and 4 sub-parts consisting of "issuedTime" "text" "url" and "validToTime", how do you start to convert this to an object? If there was only 1 main section, it would be fairly simple to do however with 3 main parts and no identification for each main sectio...

Ajax: Add new <div> from JSON with jQuery

Hi, In a page I have this HTML code: <div id="content"> <div class="container"> <div class="author">@Francesc</div> <div class="message">Hey World!</div> <div class="time">13/06/2010 11:53 GMT</div> </div> <div class="container"> <div class="author">@SomeOtherUser</div> <div class="...

What is the difference between JSON and JSONP?

Possible Duplicate: Please explain JSONP For example in the jQuery documentation I find both JSON and JSONP mentioned. What is the difference exactly? How can I see which is which? Which one should be used for what? And what does the PHP function json_encode generate? ...

using PHP to create multidimensional array from simple JSON array

I have a php query the returns the following JSON format from a table. [{"memberid":"18", "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School", }, It needs the following format: [{"memberid":"18" { "useridFK":"30", "loginName":"Johnson", "nam...

Dashcode mysql datasource binding

Hi I've got a tricky question (aren't they all tricky?) I'm converting a database driven site that uses php, to a site being built with Dashcode. The current site selects data held in a mySQL database and dynamically creates the page content. Originally this was done to reduce site maintenance because all the current content could be ...

How do I escape backslashes in JSON?

I am using Firefox's native JSON.parse() to parse some JSON strings that include regular expressions as values, for example: var test = JSON.parse('{"regex":"/\\d+/"}'); The '\d' in the above throws an exception with JSON.parse(), but works fine when I use eval (which is what I'm trying to avoid). What I want is to preserve the '\' i...

jquery json function returning null

I have a jquery script as below: $.ajax({ type: "GET", url: "http://www.site.com/v4/ajax/get_song_info.php", data: ({id : song_id }), dataType: "json", success: function(data) { alert( "Data: " + data ); } }); And the associated php page: <?php include_once '../connect.php'; $song_id = $_GET['id'...

Json_encode Charset problem

When I use json_encode to encode my multi lingual strings , It also changes special characters.What should I do to keep them same . For example <? echo json_encode(array('şüğçö')); It returns something like ["\u015f\u00fc\u011f\u00e7\u00f6"] But I want ["şüğçö"] ...

JSON array and JSF

I'm working with JSF and EXT js. I have a JSONArray created in the server-side and I want to pass it to client-side. I used to get the array and put it in javascript var. But this tag adds a html tag (span) which make an error in javascript var. This is the code I wrote: var data1 = <h:outputFormat value="#{actorBean.newactors}" /> ...

Changing JSON response root node message in WCF

Hi all, I created a REST GetTime Service in WCF and the service returns JSON as the response message. Also the WebMessageBodyStyle is set to wrapped so it would have an ID associated with that data it returns. But when I use Fiddler to test my service the response string is: {"GetTimeResult":"2010614104013"} As the response above the...

iPhone: variable type returned by yajl

Hello, I'm quite new to iphone programming and I want to do the following stuff: get data from a JSON REST web server parse the received data using YAJL Draw a graph with those data using core-plot So, 1th item is fine, I use ASIHttpRequest which runs as espected 3rd is almost fine (I still have to learn how to tune core-plot). The...