search for: evaljson

Displaying 19 results from an estimated 19 matches for "evaljson".

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 happened, I use firebug to log both the error and the transport object. When I inspect the transport object, transport.responseText is definitely there, and well-formed. Has anyone else...
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'', {...
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...
2007 Sep 28
1
evalJSON problem
...uest: new Ajax.Request(''myactions.php'', { method:''get'', parameters: {action:''bringeditor'', id:<?php echo $uid; ?>}, onSuccess: function(transport){ var response = transport.responseText; var data = response.evalJSON(); $(''maincontent'').innerHTML=data.mytextarea; eval(data.jsaction);*/ }, onFailure: function(){ alert(''Something went wrong...'') } }); and in ''myactions.php'' : $textarea= "<textarea id=''MyTextarea'...
2008 Feb 10
3
Ajax.Request evalJSON document.write hangs
...ad of document.write but it would be easier if document.write would work. Any clue as to what I''m doing wrong? CODE new Ajax.Request(''http://www.domain.com/test.json'', { method:''get'', onSuccess: function(transport){ var json = transport.responseText.evalJSON(); document.write(''ID: '' + json.items[0].id); }, onFailure: function(){ alert(''Something went wrong...'') } }); JSON FILE {"items":[ {"id":"1202263067"}, {"id":"1201111878"} ]} --~--~---------~--~----~----...
2007 Sep 21
1
Weird data from evalJSON
...ve 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 iterate over the result. Why does the object contain these function()s and how can I iterate over just my objects? Below is my code along with the strange result I am seeing. thank you for your insights. new Ajax.Request(...
2007 Jul 19
0
ASP.NET AJAX Web Services and Prototype Version 1.5.1.1
....indexOf(''json'') >= 0) { this.transport.send(Hash.toJSON(this.options.postBody)); } else { this.body = this.method == ''post'' ? (this.options.postBody || params) : null; this.transport.send(this.body); } Replace this at line 1145: evalJSON: function() { try { var json = this.getHeader(''X-JSON''); return json ? json.evalJSON() : null; } catch (e) { return null } }, With this: evalJSON: function() { try { var json = this.getHeader(''X-JSON''); var contentType =...
2007 Aug 07
2
"badly formed JSON" exception
...ils.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 transport.responseText.evalJSON(true); I get this error: SyntaxError: Badly formed JSON string: ''{foo: "bar2", etc: "rez"}'' javascript seems to expect double quote around the key strings. does anyone know how I get this to work? thanks in advance!!! Björn --~--~---------~--~----~-------...
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
2008 Aug 10
1
Prototype, JSON and headers
...d probably Linux. After a few hours of searching on the net and trial/error, this worked: <?php $json = json_encode($status); header(''Content-type: application/json''); echo $json; ?> And the javascript: onSuccess: function(transport) { var json = transport.responseText.evalJSON(); So, anyone knows WHY? I would really like to understand what is going on here. Thank you. Joe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send em...
2007 Jun 04
2
Re: Ajax.Request question with JSON return
...ON'') + '')'') (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: function() { 2. if(this.transport.json){ return this.transport.json; } 3. else 4. { 5. try { 6. return eval(''('' + this.header(''X-JSON'') + '')''); 7. } catch (e) {} 8. } 9....
2008 Feb 05
0
prototype-1.6.0.2 Newbie Why is AJAX.request fired 3 times?
...re near the bottom of the page I fire up: new Ajax.Request(''ws_adrestype.php'', { method:''get'', requestHeaders: {Accept: ''application/json''}, onSuccess: function(transport){ var json = transport.responseText.evalJSON(true); }, onError: function(){ alert(''Response was no JSON''); } }); And when I inspect the loading of the page with Firebug, I see that the request to my ws_adrestype.php is made three times. these requests get a response in 427, 260 and 121 ms. My...
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
2008 Jan 21
4
Can't change paramName with InPlaceCollectionEditor
...---------------------------------------- new Ajax.Request("myPageSel.asp", { method: "get", parameters: {r:$el.id}, onSuccess: function(xhr) { new Ajax.InPlaceCollectionEditor($el.id, ''myPageMaj.asp'', { paramName: $el.id, collection: xhr.responseText.evalJSON() }); alert($el.id); } }); --------------------------------------------------------------------------------------------------- Ajax.InPlaceCollectionEditor always sends paramName as "value". alert($el.id) return what I want and if I use InPlaceEditor instead of InPlaceCollectionEdit...
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
2009 Jul 07
0
[PATCH server] Update app to work with rails 2.3.2
...his.transport.getResponseHeader(name); + return this.transport.getResponseHeader(name) || null; } catch (e) { return null } }, @@ -1391,7 +1412,8 @@ Ajax.Response = Class.create({ if (!json) return null; json = decodeURIComponent(escape(json)); try { - return json.evalJSON(this.request.options.sanitizeJSON); + return json.evalJSON(this.request.options.sanitizeJSON || + !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } @@ -1404,7 +1426,8 @@ Ajax.Response = Class.create({ this.responseText.blank())...
2009 Jul 20
9
Upgrade server to run on Rails 2.3.2/F11
Note that one of the 8 patches (#6) will be sent separately in reply to this email, as some of the replaced lines are too long, so git won't let me send the email. However, there is nothing wrong with that patch, and it should be applied in the sequence listed below. Note also that I assume this will be tested on a clean f11 install, rather than an upgrade of an existing ovirt server
2008 Jun 26
7
Strange readyStates in prototype Ajax
Hi, I''ve never posted here before so please forgive me if I''m not observing proper decorum, yadda yadda yadda :-) I''ve ran into a very, very strange bug with Prototype I wanted to share and see if anyone else has seen this. In a few of my projects involving Ext JS, I''m using the TreePanel control, which uses AJAX to load child nodes asynchronously. Because I