i cannot seem to get any data from my ajax request for a json file.
the following function is called on an onClick:

================================================
function loadBulletin(period) {
        filetoget = "content/home/bulletin.txt";
        new Ajax.Request(filetoget, {method:'get', onSuccess:
function(transport, json){$('main_text').innerHTML =
json.bulletin[1].title;}});
}
================================================

the file bulletin (my json file) looks like this:

================================================
{"bulletin":[
{"date":"3/2/2007","time":"8PM","type":"Class","title":"Jnana
Yoga","speaker":" ","location":"Old Temple"},
{"date":"3/3/2007","time":"8PM","type":"Class","title":"The Gospel of
Sri Ramakrishna","speaker":" ","location":"Vivekananda Hall"},
{"date":"3/4/2007","time":"11AM","type":"Lecture","title":"Be Thou a
Witness","speaker":" ","location":"NT"},
]}

=================================================

my main_text div has a default value of some text that is from the
html on the original page.  even after pushing the button, the text
stays the same (which is nothing like what should be coming from the
file).  there are no errors being thrown in the error panel.  i have
tried a zillion things but will try anything else at this point. if i
replace "json.bulletin[1].title" in the code above with some string,
it prints in the div just fine, so it looks like my ajax request is
returning a success flag.  wouldnt json.bulletin[1].title return "The
Gospel of Sri Ramakrishna" based on my file above?

can anyone suggest what is wrong with my code?


--~--~---------~--~----~------------~-------~--~----~
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