Return to Snippet

Revision: 29755
at August 4, 2010 11:34 by insanedreamer


Initial Code
## view:

  .pagination
    =will_paginate @photos, :class => 'digg_pagination'


## application.js

document.observe("dom:loaded", function() {
  ajax_pagination()
})

// ajax pagination links
var ajax_pagination = function () { 
  var container = $(document.body)
    container.observe('click', function(e) {
      var el = e.element()
      if (el.match('.digg_pagination a')) {
        new Ajax.Request(el.href, { method: 'get' })
        e.stop()
      }
    })
}

Initial URL

                                

Initial Description
tag links with .click function

Initial Title
ajax pagination links

Initial Tags
ajax, javascript, rails

Initial Language
Rails