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:

http://jsfiddle.net/sy5jz/1/


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -