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: “”,
// success: function(response) {
// alert(“sucessfully executed script”);
// }
// });{
method: “./attendence.call_Attendence”, // path of function
// args: checking, // my function have no arguments
callback: function ®{

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