Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49199

multiple behaviors in a single .js file failing

$
0
0

Howdy.

I have a small helper module in D6 with a .js file that adds a function to Drupal.behaviors.

I've found that if I try to add a second behavior function, neither behavior is triggered.

so:

Drupal.behaviors.first = function (context) {
  alert('first');
}

works and shows an alert on page load. but:

Drupal.behaviors.first = function (context) {
  alert('first');
}
Drupal.behaviors.second = function (context) {
  alert('second');
}

fails, and I see no alerts on page load. is this expected behavior and/or is it documented anywhere?

thanks!


Viewing all articles
Browse latest Browse all 49199

Trending Articles