Skip to content

Automatically handles binding ajax calls to dom elements, even if the element is the result of another ajax call. It also creates a terse but readable syntax for declaring an element as an ajax bindable.

Notifications You must be signed in to change notification settings

edraut/jquery-ajax-binder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Jquery Ajax Binder

Why?

If you use jquery and you’ve ever created a web application that had any significant quantity of ajax requests initiated by links or forms, and the responses to those requests contained more links or forms that needed to be bound as ajax requests, then you’ve probably been repeating yourself ( or using the crippled jrails library if you’re using rails ).

This javascript framework provides a terse but completely flexible syntax for declaring an html element as ajax-bound, and manages the actual binding, both on initial page load and on any subsequent ajax response loads.

Usage

In your view

if you are using rails


<%= javascript_include_tag 'jquery_ajax_binder.js' %>

<%= link_to item.name, item_url(item),
:ajax_binding => “ajax_link”,
:ajax_method => ‘GET’,
:ajax_success_callback => “$(‘#some_id’).show();”,
:ajax_success_element => ‘dom_id_for_placing_the_result’
%>

or in plain html


<script type="text/javascript" src="/javascripts/jquery_ajax_binder.js"/>
<a href="http://example.com/restful/route/to/item/74"
	ajax_binding="ajax_link"
	ajax_method='GET'
	ajax_success_callback="$('#some_id').show();"
	ajax_success_element="dom_id_for_placing_the_result">

License
This library uses the same licensing as jQuery itself:
http://docs.jquery.com/License

About

Automatically handles binding ajax calls to dom elements, even if the element is the result of another ajax call. It also creates a terse but readable syntax for declaring an element as an ajax bindable.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published