1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Lambda In Jquery

Discussion in 'JavaScript' started by qadeer, Mar 9, 2013.

  1. #1
    Dynamically binding event handlers to content that has been ajaxed in with $.load without repeating yourself can be tricky. Lambda functions help you to not repeat yourself as much. jQuery uses lamdba functions everywhere, so if you're familiar with jQuery, you should be familiar with the syntax of lambda functions.
    In this example, the ajaxed-in content contains the elements that trigger a $.load over themselves.

    Make sure you're not calling the function in the callback by accidentally using prepare_links():

    This would set the callback to whatever the return value of the function is, not to the function itself.
    qadeer, Mar 9, 2013 IP
    ifreakz, iam.xavier and forumrating like this.