/    Sign up×
Community /Pin to ProfileBookmark

.live() jQuery question

If i have another page that I want to use these events… how do i change this script into a .live script??

[CODE]$(document).ready(function(){
$(‘#number’).bind(‘keyup change focus’, function(){
var field = this;
timer = setTimeout(function(){runSearch(field);}, 444);});
$(‘#number’).keydown(function(){clearTimeout(timer);});
//url selection by specifics
$(‘#phone_book tr’).data(‘bgcolor’, ‘#aaf’).hover(function(){
var $this = $(this);
var newBgc = $(this).data(‘bgcolor’);
$(this).data(‘bgcolor’, $(this).css(‘background-color’)).css(‘background-color’, newBgc);
});
//url selection by specifics
$(“#phone_book tr”).click(function(){
var id = $(this).children().first().html();
var type = $(this).parents(‘table’).siblings(‘div.module_header’).html().toLowerCase(); [/CODE]

I thought I could just change $(document).ready(function() …to…. $(document).live(function() as well as .keydown and .data to .live but i can’t seem to get it to work… help please.

?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Supplement spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...