So if I am using fbml,canvas & facebooker, can I do ajax calls? if so how? From reading it seems they support some sort of mock ajax, but I don''t really understand, can somone explain to me? If I cant do ajax, can I still do javascript? Can I use 3rd party libs like prototype & scriptaculous? thanks Joel
Joel, Check out the facebook wiki on this: http://wiki.developers.facebook.com/index.php/FBJS As far as in your views, you can''t use the built in view helpers, you''ll have to code stuff from scratch as the wiki explains. In your controllers and models, everything is the same as a regular rails app. BJ ----- BJ Clark the science department bjclark at scidept.com www.scidept.com On Jan 25, 2008, at 9:45 AM, Joel Nylund wrote:> So if I am using fbml,canvas & facebooker, can I do ajax calls? if so > how? > > From reading it seems they support some sort of mock ajax, but I > don''t really understand, can somone explain to me? > > If I cant do ajax, can I still do javascript? > > Can I use 3rd party libs like prototype & scriptaculous? > > thanks > Joel > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080125/2de8285d/attachment.html
Plain JavaScript is not allowed in FBML apps. You''ll have to use FB''s "mock AJAX" and/or FBJS. Shawn On Fri, 25 Jan 2008 11:45:46 -0500, Joel Nylund wrote:> So if I am using fbml,canvas & facebooker, can I do ajax calls? if so > how? > > From reading it seems they support some sort of mock ajax, but I > don''t really understand, can somone explain to me? > > If I cant do ajax, can I still do javascript? > > Can I use 3rd party libs like prototype & scriptaculous? > > thanks > Joel > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk
Does anyone have a working example of ajax with facebooker & rails running within a canvas? How about using the new "useLocalProxy "? Here is the approach im thinking of: Assumptions: - Since I cant use prototype (I dont think I can at least), as BJ said I cant use the view helpers. - I also cant use the render stuff in the controller as it renders a prototype js response right? Approach Pretty much roll your own (good place for facebooker to pick up the slack maybe?) Ive done some trial and error and here are my problems so far: - If I go through the callback url, I get a bunch of fbml crap in the response of the ajax request, even when I mark it RAW - If I use the local proxy method, I get a direct connect, but what do I do to validate the user is logged in and get their ID in this case? For responses, I could use just a RAW string, or try to encode as JSON? thanks Joel On Jan 25, 2008, at 12:02 PM, BJ Clark wrote:> Joel, > Check out the facebook wiki on this: http://wiki.developers.facebook.com/index.php/FBJS > > As far as in your views, you can''t use the built in view helpers, > you''ll have to code stuff from scratch as the wiki explains. > In your controllers and models, everything is the same as a regular > rails app. > > BJ > ----- > BJ Clark > the science department > bjclark at scidept.com > www.scidept.com > > > On Jan 25, 2008, at 9:45 AM, Joel Nylund wrote: > >> So if I am using fbml,canvas & facebooker, can I do ajax calls? if so >> how? >> >> From reading it seems they support some sort of mock ajax, but I >> don''t really understand, can somone explain to me? >> >> If I cant do ajax, can I still do javascript? >> >> Can I use 3rd party libs like prototype & scriptaculous? >> >> thanks >> Joel >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080206/43ff7ff4/attachment-0001.html
I''ve been using the javascript with AJAX for a bit. Here are some of the things I''ve learned: Prototype does not work, so you have to roll your own. If you''ve got questions, I can answer questions what I''m using, but my code is sadly not abstracted enough yet to use as a library. Hopefully when I have some time. I haven''t been able to get useLocalProxy working reliably. It appears to only work on port 80, which makes testing it a pain in the butt--I''ll reconfigure my tunnel eventually to hit port 80 and test, but I don''t have working experience with that yet. My solution for returning AJAX calls right now is to use render :text=>"something", which is working, but certainly not elegant. You can use yourAjaxObject.requireLogin = true; to pass all the login parameters along with the request. The other tricky thing is that it''s not a real AJAX request, so you can''t use ".xhr?" to determine if the request is an AJAX call. You have to use "if params[:fb_sig_is_ajax] " instead. My only other suggestion is to use Firebug to watch the calls go out. It helps a lot to see what you''re getting back. David Newbury On Feb 6, 2008 10:19 AM, Joel Nylund <jnylund at yahoo.com> wrote:> Does anyone have a working example of ajax with facebooker & rails running > within a canvas? > > How about using the new "useLocalProxy "? > > Here is the approach im thinking of: > > Assumptions: > > - Since I cant use prototype (I dont think I can at least), as BJ said I > cant use the view helpers. > - I also cant use the render stuff in the controller as it renders a > prototype js response right? > > Approach > Pretty much roll your own (good place for facebooker to pick up the slack > maybe?) > > Ive done some trial and error and here are my problems so far: > > - If I go through the callback url, I get a bunch of fbml crap in the > response of the ajax request, even when I mark it RAW > > - If I use the local proxy method, I get a direct connect, but what do I do > to validate the user is logged in and get their ID in this case? > > For responses, I could use just a RAW string, or try to encode as JSON? > > thanks > Joel
I have a fb_link_to_remote that works with :update, let me try to clean that up and add it in. Mike On Feb 6, 2008, at 10:19 AM, Joel Nylund wrote:> Does anyone have a working example of ajax with facebooker & rails > running within a canvas? > > How about using the new "useLocalProxy "? > > Here is the approach im thinking of: > > Assumptions: > > - Since I cant use prototype (I dont think I can at least), as BJ > said I cant use the view helpers. > - I also cant use the render stuff in the controller as it renders a > prototype js response right? > > Approach > Pretty much roll your own (good place for facebooker to pick up the > slack maybe?) > > Ive done some trial and error and here are my problems so far: > > - If I go through the callback url, I get a bunch of fbml crap in > the response of the ajax request, even when I mark it RAW > > - If I use the local proxy method, I get a direct connect, but what > do I do to validate the user is logged in and get their ID in this > case? > > For responses, I could use just a RAW string, or try to encode as > JSON? > > thanks > Joel > > On Jan 25, 2008, at 12:02 PM, BJ Clark wrote: > >> Joel, >> Check out the facebook wiki on this: http://wiki.developers.facebook.com/index.php/FBJS >> >> As far as in your views, you can''t use the built in view helpers, >> you''ll have to code stuff from scratch as the wiki explains. >> In your controllers and models, everything is the same as a regular >> rails app. >> >> BJ >> ----- >> BJ Clark >> the science department >> bjclark at scidept.com >> www.scidept.com >> >> >> On Jan 25, 2008, at 9:45 AM, Joel Nylund wrote: >> >>> So if I am using fbml,canvas & facebooker, can I do ajax calls? if >>> so >>> how? >>> >>> From reading it seems they support some sort of mock ajax, but I >>> don''t really understand, can somone explain to me? >>> >>> If I cant do ajax, can I still do javascript? >>> >>> Can I use 3rd party libs like prototype & scriptaculous? >>> >>> thanks >>> Joel >>> >>> _______________________________________________ >>> Facebooker-talk mailing list >>> Facebooker-talk at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/facebooker-talk >> > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com