JS behaviours

 

Our Agenda

 

  • What
  • Why
  • When
  • How

Why

  • It gives you contextual Code
  • Easy to extend
  • Simple to manage

What

 

  • Definition inside drupal.js
  • AttachBehaviour() to attach the behaviour
  •  

When

 

  • When writing code for document ready

For hooking to ajax

 

If you want to make your code expandable and manageable

 

How

 

What is drupal settings

 

What is context

Demo

JS behaviours

By Swastik Pareek

JS behaviours

  • 395