added an example of delegate #js