Jquery's three methods for passing and receiving Bind method parameters

  • 2020-03-30 03:26:05
  • OfStack

Method a,


function GetCode(event)
{
alert(event.data.foo);
}

$(document).ready(function()
{
$("#summary").bind("click", {foo:'abc'} ,GetCode);
});

Method 2,

Handle to the function


$("#summary").bind("click", function()
{
GetCode("abc")
});

function GetCode(str)
{
}

Methods three,


Related articles: