Hello,
Sorry of this comes across as a silly question but I was wonder which is the
better approach (or are they essentially the same thing?). Description - A div
called skill-list houses hundreds of drop downs with the class
skill-level-selector. When one of these selcts are changed an ajax call is
made. Code below --
$('.skill-level-selector').live("change", function(){
$.post(
'someUrl',
{
skillId: this.id.split('-')[2],
level: $(this).val()
},
function(data, textStatus){ }
);
});
---- OR ----
$('#skill-list').bind("change", function (e) {
var target = $(e.target);
if(target.is('.skill-level-selector')){
$.post(
'someUrl',
{
skillId: e.target.id.split('-')[2],
level: target.val()
},
function(data, textStatus){ }
);
}
});
As far as I can see they appear to so the same thing so perhaps the first is a
bit more succinct- am I right in that assumption. Also according to the live
api page it says change is UNsupported but both of these examples work for me
so perhaps it's not fully UNsupported?
Regards,
James.
--------------------------------------------------------------------
This e-mail is intended solely for the addressee and is strictly confidential;
if you are not the addressee please destroy the message and all copies. Any
opinion or information contained in this email or its attachments that does not
relate to the business of Kainos
is personal to the sender and is not given by or endorsed by Kainos. Kainos is
the trading name of Kainos Software Limited, registered in Northern Ireland
under company number: NI19370, having its registered offices at: Kainos House,
4-6 Upper Crescent, Belfast, BT7 1NT,
Northern Ireland. Registered in the UK for VAT under number: 454598802 and
registered in Ireland for VAT under number: 9950340E. This email has been
scanned for all known viruses by MessageLabs but is not guaranteed to be virus
free; further terms and conditions may be
found on our website - www.kainos.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---