jQuery Wrapper API

Component ID

1714198

Component name

jQuery Wrapper API

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This module offers a PHP function that will wrap your inline Javascript for you in the manner described at http://drupal.org/node/171213.

For example, the following PHP code:

$jquery = '$(".title").hide();';
print jquery_wrapper_api_wrap('myNodeTplPhp', $jquery);

prints the following HTML :

<script type="text/javascript">
<!-- 
  (function ($) {
    Drupal.behaviors.myNodeTplPhp = {
      attach: function (context, settings) {

       $(".title").hide();
          
      }
    };
  }(jQuery));
// -->
</script>