Rommel Castro
Rommel Castro

Reputation: 460

jQuery 1.7 to 1.4

i'm working with drupal and the current version of jQuery for drupal is the 1.4, but in the current HTML the developer used the ON(). function, how can i adapt this for 1.4?

$('body').on('click.button.data-api', '[data-toggle^=button]', function (e) {
                var $btn = $(e.target)
                if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
                $btn.button('toggle')

Upvotes: 1

Views: 200

Answers (2)

Chase
Chase

Reputation: 29559

Have you checked into the .bind('click') event?

http://api.jquery.com/bind/

$('#foo').bind('click', function() { alert('User clicked on "foo."'); });

Upvotes: 1

leopic
leopic

Reputation: 3012

jQuery 1.3 used 'live', before being superseeded by on http://api.jquery.com/live/

Upvotes: 1

Related Questions