jquery - Passing multiple parameters to a function -
how can pass 2 parameters in function?
what i've tried:
function loadweek(loader,button){ var button_2 = button + "_2"; alert(button_2); alert(button); alert(loader); } $("#load_week").click(function () { loadweek("#load_weekme","#load_week"); });
alert(loader);
working, button "undefined"
the button
undefined because there not exist element in document id
of load_week_2
. double check code.
the way you're passing parameters correct, seen success of loader
parameter.
update:
working fiddle:
Comments
Post a Comment