similar to: Respond to and render JSON in [5694]

Displaying 20 results from an estimated 20000 matches similar to: "Respond to and render JSON in [5694]"

2007 Aug 07
2
"badly formed JSON" exception
I tried to implement the "Rendering JSON in actions" example from http://wiki.rubyonrails.com/rails/pages/HowtoGenerateJSON : @headers["Content-Type"] = "text/plain; charset=utf-8" data = { :foo => ''bar'', :etc => ''rez'' } render :text => data.to_json When I try to decode this in javascript with
2006 Nov 12
1
prototype and json
I''m using the "Prototype JavaScript framework, version 1.5.0_rc1" and when I add the json.js script (http://www.json.org/js.html) to the document, I get an "Too much recursion" error. Is this version of prototype making some incompatibilities with json.js? Have prototype built in methods for working with json (array 2 json, object 2 json, etc)? Thanks.
2008 Aug 10
1
Prototype, JSON and headers
Hi everyone. I love JSON and using Prototype has help me reduce the code to handle AJAX responses. But one thing keeps me confused and sometimes even frustrated. I don''t really understand what is going on with the headers, so if someone could take some time to explain what is going on, I (and probably a lot more people) would be very thankful. The thing is this. On my local server (Mac OS
2008 Jan 16
2
InPlaceEditor and Json in onComplete
Hi, after some search, i found this Collin Mollenhour said: While IPE is being patched, it''d be nice if the JSON evaluated response was available in onComplete. http://groups.google.fr/group/rubyonrails-spinoffs/browse_thread/thread/f6cfdfc9e535f2ef/f61d98f55f055e55?lnk=gst&q=inplaceeditor+json#f61d98f55f055e55 It''s in 2006, some news about that ? Cause i''ve tried
2007 Jun 04
2
Re: Ajax.Request question with JSON return
Do I need something like this: eval(''('' + this.header(''X-JSON'') + '')'') (taken from Cody Swann, http://ajaxian.com/archives/prototype-extension-dynamic-script-pattern-support ). I''m guessing my problem is simpler, and I''m leaving something small out related to the header though. Thanks for any help -Mark 1. evalJSON:
2006 Apr 24
1
JSON Validator
Maybe I am missing something very obvious, but guys does anyone know of any JSON Validators around? The reason is when you do an eval(json_response), if the JSON format is not proper, you''ll only get an error like "Can''t eval..". But, this doesn''t help identify where the actual problem lies. Is there some kind of a schema or something we can write to check
2007 Apr 12
6
JSON handling in Prototype 1.5.1_rc2
Hi, I try to use the JSON encoder/decoder on JSON string receive from an HTTPRequest. And it failed to handle characters with accents (çéèà...) giving me an parsing Exception. I think because the convertion from string to object is a simple eval ! This make Protoype unusable for non americain characterset application ! Or I miss something ! Sad ! Constant
2008 Jan 17
4
JSON query problems
I am constructing a JSON object that is an array of products. Using a select box, I want to find the object in the array that has an ID that matches the value from the selectedIndex of the select box and return the price. Here is the JSON script: var products = [{''ID'': 16378, ''Cost'': 100.00},{''ID'': 16377,''Cost'':
2007 Jul 08
2
problems using ajax call inside a json object.
Hi all im new at this list, i have a problem when i make an ajax call inside a json object. Whe i test using IE works but when i use firefox nothing happend. you can see the problem at: http://mandela.no-ip.info/prototypeproblem/index.html I appreciate any kind of help / suggestion thanx in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2007 Jul 27
0
JSON instead of unordered list in Autocompleter
Hi I was wondering if anybody knows of an extension to the Autocompleter that would allow us to send a JSON object from the server rather than an unordered list? How hard would it be to implement something like that? Cheers, Tench --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 Jul 29
0
How does Rails respond to Ajax with JSON?
In Ruby on Rails, why = render :json => array_data shows nothing (as seen in Firebug, the GET in the console), but - response.content_type = "application/json" = render :text => array_data.to_json shows the data array? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2007 Jun 14
4
How to convert a table to JSON (or to Javascript array)
Is there a way to retrieve an HTML table in javascript and convert it to JSON using prototype? I''m stumped :( phil --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To
2012 Mar 26
3
render :json not sending any data back ...
[rails 3.2.2] I perform an ajax call : ... $.ajax url: " /backoffice/expenses/rate" type: "GET" dataType: "json" data: project_id: $(''#project_id'').val() code: $(this).val() success: (result) -> alert result $(''#expense_price'').val(result) in
2006 Jun 22
0
Scriptaculous Sortable Demo
In case anyone is interested, I just put together a demo using Sortable to preview Typo themes: http://www.dev411.com/typothemes/ Nice to see it in action. John _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
2007 Apr 13
2
Is JavaScript JSON Hijacking problems present/considered in Prototype's coming release?
I sort of let things loose on Prototype''s growth for awhile - yet, as the article (found here: http://webreflection.blogspot.com/2007/04/are-130-byte-enought-to-solve.html) came before me, the question arose: ''is the issue considered in Prototype?'' I couldn''t find a bug regarding it: the one in German isn''t counted. ) So I roll it in here. Please
2010 Oct 31
0
Error in rendering json
Hello, in my controller I use following code to render json. render :json => @product, :callback => params[:callback] I would expect (for example) following to be rendered: callback({"name":"Computer","price":500}) Instead, it renders: callback([{"name":"Computer","price":500}]) Notice the square brackets which disables
2007 Jul 19
0
ASP.NET AJAX Web Services and Prototype Version 1.5.1.1
I wanted to use a web service published with ASP.NET AJAX from Prototype Version 1.5.1.1 It''s easier to call an ASP.NET AJAX web service by using an ASP.NET AJAX page with a proxy class, but I have an application which still has many Classic ASP pages and using Prototype seemed like a better idea than hand coding the the interactions, or figuring out how to include all the right ASP.NET
2005 Dec 22
0
RE: Re: ajax - multiple updates on singlexmlhttprequest
>From looking at the Prototype code, it looks like any text in the ''X-JSON'' header will be eval''d and passed as the second parameter to your onSuccess handler. Your handler function could then be (using all the power of Prototype): var handlerFunc = function(t, json) { // Update info container Element.update(''someId'', json.foo); } But your
2006 May 28
13
JSON not auto-evaluated
Hi, please consider this stripped down example: new Ajax.Request(''foo.php'', { onSuccess: function(t, json) { alert(json.myParam); } }); According to http://www.sergiopereira.com/articles/prototype.js.html, the second param is supposed to be the evaluated json object IF the X-JSON header is send in the response. I send the header in my script. However, the json var
2008 Feb 10
3
Ajax.Request evalJSON document.write hangs
I''m not the best when it comes to javascript so this is probably a simple mistake. I''m using the following code to read an external json file and print out its values. The problem is when I try to write the value to the browser it causes the browser to load like it hasn''t finished the javascript code. Its writing the value to the screen so I think its hanging after that