/readyfor.js

jQuery on ready helper plugins.

Primary LanguageJavaScriptThe UnlicenseUnlicense

readyfor.js

jQuery on ready helper plugins.

Simple Usage Rails Example

Add id/class to your body tag as follows:

  <body id="<%= controller_name -%>-controller" class="<%= action_name -%>-action">

Trigger on ready events..

Explicitly

  $(document).ready_for_selector("#awesome-controller.show-action", function() {
    "use strict";
    .
    .
    .
  });

With some helpers....

  $(document).ready_for_controller("awesome", function() {
    "use strict";
    .
    .
    .
  });
  
  $(document).ready_for_controller_action("awesome", "show", function() {
    "use strict";
    .
    .
    .
  });