I would like to know what existing PHP libraries/classes have you used for your REST+JSON projects.
If I need to create a wrapper for social engines API such as Facebook and/or Twitter API, what existing PHP REST JSON architecture do you recommend?
JSON CONSUMING DEVICE (not PHP based) <--> PHP REST SERVICE <--> SOCIAL API
...
Hi Folks,
I know about ajax cross-domain policy.
So I can't just call "http://www.google.com" over a ajax HTTP request and display
the results somewhere on my site.
I tried it with dataType "jsonp", that actually would work, but I get a syntax error (obviously because the received data is not json formated)
Is there any other possibli...
I am implementing a jquery autocomplete on a search form and am getting the suggestions from the Google Search Appliance Autocomple suggestions service which returns a result set in json.
What I am trying to do is go off to the GSA to get suggestions when the user types something in the search box.
The url to get the json suggestions i...
I have a date with a time. I'm using ruby, but the language shouldn't matter.
d = "2010-04-01 13:00:00"
What is the best way to format this date for Mongo DB? By 'best' I mean, is there a certain format I could use where Mongo would recognize it as a date and might give me more-advanced filtering optons?
ie: If formatted correctly, c...
Hello,
I would like to know if JSON with AJAX has a limitation to the amount of data an outgoing and returning parameter can carry?
I would like to be able to send and return from the server a file with 10,000 lines, as a string. How should I achieve this task? Will a single parameter will be able to hand this?
EDIT:
My client is Java...
Hello,
I am trying to build JSON from two fields. Say, I have a list of object(party), and I only need to pass 2 items as JSON pair.
def list = getMyList() //it contains 2 party objects
partyTo = array {
for (i in list) {
x partyId: i.id
y partyName: i.toString()
}
}
The JSON string is
{"partyTo":[
...
Hi,
I'm trying to return the ajax success array from one function to another. For some reason I don't seem to be able to pass the data stored in a variable in the success part of the ajax function into the parent function to return.
I looked at this post to try and figure things out, but not such luck:
http://stackoverflow.com/questio...
Hey all,
I am unable to get a highcharts plugin to render a chart in a rails application:
http://github.com/loudpixel/highcharts-rails
I believe it has something to do with the sql queries to the database placed in a ruby array, which the javascript is unable to intepret. This is what I have:
def panels
pass = Student.find_by_sql('SEL...
Hello all,
How can I loop through this json data without referring to the data items by a number. I would like to use it as an associative array. I have this so far:
$.post('/controlpanel/search', { type: type, string: string }, function(data){
$.each(data, function() {
$.each(this, function(index, itemData) {
...
When sniffing Gmail and Facebook traffic, I found there are leading deadlock code before JSON response of XmlHttpRequest.
For example
for (;;);{"t":"continue"}
and
while(1); [["v","nW3OxUDq0kU.en.","8","51bec53f21305d9c"],["di",86]]
What is the purpose of this "for(;;);" and "while(1);" deadlock?
...
This piece of valid json (it has been generated using php's json_encode):
{"html":"form is NOT valid<form id=\"articleform\" enctype=\"application\/x-www-form-urlencoded\" method=\"post\" action=\"\"><dl class=\"zend_form\">\n<dt id=\"title-label\"> <\/dt>\n<dd id=\"title-element\">\n<input type=\"text\" name=\"title\" id=\"title\"...
If I have a block of code like this:
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
end
end
How do I add something like
format.json
Any tips, pointers, ideas gladly welcomed...
...
I can't seem to get JSON.pretty_generate() to actually generate pretty output in Rails.
I'm using Rails 2.3.5 and it seems to automatically load the JSON gem. Awesome. While using script/console this does indeed produce JSON:
some_data = {'foo' => 1, 'bar' => 20, 'cow' => [1, 2, 3, 4], 'moo' => {'dog' => 'woof', 'cat' => 'meow'}}
som...
I'm using json to pass data between the browser and a java server.
I'm using Json-lib to convert between java objects and json.
I'd like to strip out susupicious looking stuff (i.e "doSomethingNasty().) from the user input while converting from json to java.
I can imagine several points at which I could do this:
I could examine the...
I am currently trying to pass a generated JSON string to dojo for parsing and am having some issues. The servlet simply writes it as a string as so:
response.getWriter().append("{ \"data\": {");
response.getWriter().append("\"type\": \"facing\",");
response.getWriter().append("\"score\": " + "\"" + score + "\",");
response.getWriter()....
I'm buiding an HTML/jQuery site where almost all the content comes from remote JSON data. I'm having trouble coming up with a good way to store and access the data in the future (scope-wise).
Currently, I've written a jQuery plugin that gets the JSONP data when the site loads. But I have other functions and jQuery plugins that need to ...
I made a yahoo pipe that pulls up the atoms as json format; however, I can fetch and display all the elements in my html page except for the element's attribute.
Would anyone tell me how to fetch the media:thumb element's attribute from a json feed?
I am pasting the html page's code with javascript. If you save the html page and then ...
Hello,I wrote somethinh like this,
`$sql = "SELECT * FROM dbase";
$strOptions = "";
if (!$q=mysql_query($sql)) {
$strOptions = "<option>There was an error connecting to database</option>";
}
if (mysql_num_rows($q)==0) {
$strOptions = "<option>There are no news in database</option>";
}else {
...
Update II
I Figured this out. When using google maps api, the model must not be named "maps". to_json works after I created a new model name.
Update
@maps is the name of my model, it contains information such as address, longitude, latitude. When I replace <%= @maps.to_json %>; to <%= @maps %>, the HTML renders ActiveRecord::Relation...
I may be missing something obvious here, but how could I rewrite this code so that it doesn't need the theVariable to be a global variable ?
<script language="javascript">
theVariable = "";
function setValue() /* called on page load */
{
/* make ajax call to the server here */
theVariable = "a string of json data waiti...