If I download it and try to run it straight from my desktop I get the error exactly as you describe.
Request.JSON can't send an http request because I'm not running it from a web server, it's just a local file. That's also why I can click "see data.json" and get the file because it's not a xhr request, but simply a linked file. Are you running any sort of server? Or did you just download it and pop it open? On May 20, 12:20 pm, Fábio Costa <fabiomco...@gmail.com> wrote: > Sure, send it... > > Fábio Miranda Costa > Engenheiro de Computaçãohttp://meiocodigo.com > > > > On Wed, May 20, 2009 at 3:15 PM, JB <riesenweb...@gmail.com> wrote: > > > var request = new Request.JSON({ > > url: demo_path + 'data.json', > > secure:false, > > onComplete: function(jsonObj) { > > addImages(jsonObj.previews); > > } > > > Still gives me the same error. Would it help if I emailed you the > > link? Thanks for your replys. > > > On May 20, 11:10 am, Fábio Costa <fabiomco...@gmail.com> wrote: > > > Try putting secure: false. > > > > var request = new Request.JSON({> > url: demo_path > > + 'data.json', > > > > > secure: false, > > > > onComplete: function(jsonObj) { > > > > > > addImages(jsonObj.previews); > > > > > } > > > > > }).send(); > > > > Fábio Miranda Costa > > > Engenheiro de Computaçãohttp://meiocodigo.com > > > > On Wed, May 20, 2009 at 3:04 PM, JB <riesenweb...@gmail.com> wrote: > > > > > It's there in the same folder and when i click on "see data.json" it > > > > loads the file. > > > > > On May 20, 10:53 am, Fábio Costa <fabiomco...@gmail.com> wrote: > > > > > You should check if the file referenced by the url key (demo_path + > > > > > 'data.json') is there on the server. > > > > > Check your firebug console to se if it is giving you a 404 error. If > > it > > > > is > > > > > giving 404 errors its because the file isnt there. > > > > > > Fábio Miranda Costa > > > > > Engenheiro de Computaçãohttp://meiocodigo.com > > > > > > On Wed, May 20, 2009 at 2:10 PM, JB <riesenweb...@gmail.com> wrote: > > > > > > > I downloaded the json request sample from > > > > > >http://demos.mootools.net/Request.JSON > > > > > > and as is it gives me the following error from demo.js > > > > > > > "jsonObj is undefined." > > > > > > > Here is the code the error is referring to in demo.js > > > > > > > " > > > > > > $('loadJson').addEvent('click', function(e) { > > > > > > e.stop(); > > > > > > var request = new Request.JSON({ > > > > > > url: demo_path + 'data.json', > > > > > > onComplete: function(jsonObj) { > > > > > > addImages(jsonObj.previews); > > > > > > } > > > > > > }).send(); > > > > > > }); > > > > > > " > > > > > > > I am am new to this is there something I need to setup on the > > server > > > > > > to have this sample function correctly? I am assuming it's not > > > > > > anything in the code since I didn't change anything from the sample > > > > > > downloaded from mootools. > > > > > > > Thanks for you help! > > > > > > Jon