Ok, some progress here.

First thing, I found that all the JSON stuff was in 1.5.1, and I had
the 1.5.0 script. *bonk*

Just doing some testing, I found I was able to parse out the example
JSON structure data from the page:
http://www.prototypejs.org/learn/json

and see the values via alerts.

Next, I created my own simple JSON structure, did the same thing,
all's fine.

Now, when trying to pass that exact same JSON structure in from the
page called via the 'url' param, nada.

I hit the page called via the 'url' param, and the results are what
I'm expecting - the JSON structure I'm creating - but it's in plain
text.

Here's the JSON structure my script is currently passing back (with
test data);

{"queueData": [ {"BLID": "3540", "BGColor": "fffff2"} ]};

My functions are currently as follows:
*********************

function updateQueue() {
        var url = (valid url string);
        var ajax = new Ajax.Request(
        url,
        {
                method: 'get',
                onComplete: updateQueueDivs,
                onFailure: reportError
        });
        }

        updateQueueDivs = function(retValue) {
                alert('start ' + retValue.responseText.length);
                var testdata = retValue.responseText.evalJSON();
                alert('hmm');
                alert(testdata.queueData[0].BLID);
}

updateQueue();

**********************
This is all at the bottom of the script, so the last thing that gets
hit is that 'updateQueue()' call. It calls the first function, which
then calls the 'updateQueueDivs' function. I get a value in that first
alert - but it's 298, much larger than the length of the JSON
structure string - and then, I don't get the 'hmm' alert - it's
choking on the evalJSON() bit.



--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to