similar to: "badly formed JSON" exception

Displaying 20 results from an estimated 300 matches similar to: ""badly formed JSON" exception"

2008 May 24
5
TypeError : transport.responseText has no properties
Hello all, I''m using prototype in conjunction with Extjs to build out an Ajax- driven app. I''m noticing that occasionally there will be Ajax Requests that will occasionally not complete. After some investigation, I found that when I made a call to String#evalJSON, it would throw a TypeError with the following message : transport.responseText has no properties. When this
2007 Sep 28
2
Rails shouldn't output invalid JSON by default
Please check out this ticket (which would explain almost everything): http://dev.rubyonrails.org/ticket/8762 So basically, Rails to_json methods produces invalid JSON out of the box as it doesn''t quote all hash keys. This is valid JSON: { "id": 6589, "code": "SIN", "name": "Singapore" } This is not (Rails'' JSON encoders
2006 Apr 17
0
doing synchronous JSON on rails
So I have found how to generate json in a rails app in the wiki (http://wiki.rubyonrails.com/rails/pages/HowtoGenerateJSON), what I have yet to figure out is how to make a synchronous call via json to rails so that I can block while fetching the information from a user request. context: I have used JSON on top of java in the past, and in order to make synchronous calls I had to do the
2008 Feb 09
1
problem using evalJSON with Ajax
Hi, all I am trying to use evalJSON with Ajax, but somehow it doesn''t work. for instance, I have a php file has the following output: "name": "Violet", "occupation": "character" and I have a html file with the following javascript: new Ajax.Request(''/some_url'', { method:''get'', onSuccess:
2008 Jan 03
2
Interresting Changeset for Rails Trunk...
>From http://blog.codefront.net/2008/01/02/whats-new-on-edge-rails-the-pilot/ A native Mongrel handler has been introduced. This is so that it can be worked on independent of Mongrel?s release cycle (the Rails handler is currently in the Mongrel codebase). Jeremy Kemper (bitsweat) has already made a minor performance improvement by moving the mutex from the handler itself into the dispatcher.
2005 Sep 25
14
script.aculo.us 1.5 release candidate 1
So, the first script.aculo.us 1.5 release candidate is out! Important changes and fixes from 1.5_pre4 (for a detailed list, see the CHANGELOG file): * Droppables w/greedy and hoverclass are now reverted when dragged item is no longer over them, fixes #2184 * Let Effect.Highlight correctly parse IE colors, add String.prototype.parseColor() for this, fixes #2037 * Make scriptaculous.js work
2007 Dec 20
1
evalJSON() problem
Hey! When i try to parse the following Variable with evalJSON() i geht an error "Badly formed JSON String" var string = ''{nodes[{id:"s1",type:"seminar",title:"Seminar 1",nodes: [{id:"c1",type:"course",title:"Kurs 1"}]},{id:"c2",type: "course",title: "Kurs 2"}]};''; why? regards
2007 Sep 28
1
evalJSON problem
Hey there, I have a FCKeditor(a WYSIWYG online html editor) and i want to bring it to a page by Ajax and JSON by a php request-catcher. I have sth like this in my ajax request: new Ajax.Request(''myactions.php'', { method:''get'', parameters: {action:''bringeditor'', id:<?php echo $uid; ?>}, onSuccess: function(transport){
2008 Jul 12
0
to_json in Rails 2.0.2 not generating proper json?
I am using Rails 2.0.2 and trying to use to_json to generate json. I notice several problems. 1) datetime field such as created_at mapped to "created_at": {} 2) :except does not work, @post.to_json(:except => [:created_at, :updated_at] still gives me "created_at": {}, "update_at": {} 3) problem with escaped char mapping: ''<'' mapped to
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
2007 Sep 21
1
Weird data from evalJSON
I am trying to have prototype perform a request and return to me a javascript object representing the json string returned by the request. I want to iterate over the contents to print each object in the json string. The value of transport.reponseText in onSuccess is what I would expect. But once I try to perform evalJSON() on this text it gives me a bunch of extra function()s when i try to
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:
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 30
0
Help with JSONified objects from ActiveRecord
Hello guys, I''m trying to return a custom JSON response to a client frontend. The object I''m trying to return is a User, with some associated Locale data. So basically I need to put the User data and his Locale in a "data" property in the JSON response. If this worked, it would be perfect: json = Hash.new json[:success] = false json[:data] = User.find(params[:id],
2008 Feb 25
1
string to hash
how do i turn a string into a hash? why does this not work??? var test = "{ test: ''dfgj''}"; console.log($H(test).inspect()) half the prototype source code get inside the hash it makes??? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to
2006 Feb 08
29
Autocomplete and Firefox
Having problems with the autocomplete on my linux box and firefox. When I use form tags it breaks, without form tags everything works fine. Exact copy of the example provided, but I added form tags.. The initial search and select works but then the box sort of "locks up" and I can''t change it at all, If I do try to type something nothing changes but a second later the whole
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
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
2008 Jan 30
0
Publish templatized action with JSON gotcha in Rails 1.2
Hey guys- to_json in Rails 1.2 produces json with unquoted keys, which is invalid. Therefore, publish_templatized_action produces invalid json for feed publishing, and you''ll get an error from Facebook. To fix this, put this line in environment.rb: ActiveSupport::JSON.unquote_hash_key_identifiers = false You don''t need to do this if you''re running Rails 2.0. Just a
2006 May 27
5
ActiveSupport JSON working?
Hi, I am trying to convert a hash to JSON using ActiveSupports built in .to_json. I am doing similar to the example below but are there certain strings that could go in place of ''bar'' or ''rez'' that will break the to_json method? I am using a very long string from rjs output in place of ''bar''. Perhaps .to_json is not ready yet? Thanks, Peter