Call Python function in JavaScript

I have python function which is executing fine and i can collect result, but i want to call it when button is clicked, so i am calling python function from JS file. it only disply alert message and nothing else. Here is my JS function code:
cur_frm.cscript.submit = function(frm) {
alert(“Hi,Get all Users Now”);
// I used different methods from this forum but no use.
// $.ajax({
// url: “attendence.py”,
// success: function(response) {
// alert(“sucessfully executed script”);
// }
// });
frappe.call({
method: “./attendence.call_Attendence”, // path of function
// args: checking, // my function have no arguments
callback: function (r){
alert(“data:”,r);
}
})
}

I have solved the issue: The URL to method was wrong.