Slideshare.net (beta)

 
Post: 
Myspace Hi5 Friendster Xanga LiveJournal Facebook Blogger Tagged Typepad Freewebs BlackPlanet gigya icons



All comments

Add a comment on Slide 1

If you have a SlideShare account, login to comment; else you can comment as a guest


Showing 1-50 of 3 (more)

Ajax and RJS

From dominiekth, 3 months ago

Brief overview of using Ajax with PrototypeJS and RubyOnRails' RJS

1247 views  |  0 comments  |  3 favorites  |  34 downloads  |  3 embeds (Stats)
 

Tags

prototype json comet spinning spinner javascript rubyonrails rails ruby ajax

more

 
 

Groups/Events

Not added to any group/event

 
 

Privacy InfoNew!

This slideshow is Public

 
Embed in your blog
Embed (wordpress.com)
custom

Slideshow Statistics
Total Views: 1247
on Slideshare: 1101
from embeds: 146* * Views from embeds since 21 Aug, 07

Slideshow transcript

Slide 1: Ajax and RJS

Slide 2: Yes, Macs Rule

Slide 3: Ajax • mini web request from javascript • used to update pieces of content in page

Slide 4: When NOT to use AJAX • when the action is related to navigation • when there is another AJAX call inside that action (will get very complicated)

Slide 5: Cons of AJAX • can slow down a page just as easy as speed up a page • explosion of partials

Slide 6: Pros of AJAX • when done well, it will make the user experience much better • saves server traffic and potentially load • and...

Slide 7: It’s cool.

Slide 8: How does it work? Something like this: You always need a library.

Slide 9: Using PrototypeJS new Ajax.Updater('my_div', '/items'); text, partial or template from server new Ajax.Request('/items') javascript from server

Slide 10: Ruby Java Script Controller: RJS template:

Slide 11: JS Generating Methods • page is the virtual page object where you can write javascript to.

Slide 12: Inline RJS • no template • in the controller

Slide 13: Rails’ Helpers

Slide 14: Using a Spinner • link_to_remote_submit already has a spinner. • put a spinner onclick, not on the callbacks • disable the spinner onComplete or on content update

Slide 15: spin_div Spinner is created in the container and gets reset when container gets updated.

Slide 16: Status Notice JS

Slide 17: Alternative and Related Techniques

Slide 18: JSON

Slide 19: Cross-Server JS

Slide 20: Comet, AJAX' big brother synchronous VS asynchronous <%= periodically_call_remote %> sucks push javascript from server, using a flash socket

Slide 21: copyleft dominiek.com