Link to pass parameters to function?
So i want to run a function after a link has been clicked.
The link i would like to point to the function is the cancelLink, the
first link is here to show you as an example how i'm getting the
AppointmentId the first link works by passing a parameter to another page.
The Cancel link is the link i would like to run a function on the current
page.
Here are my links:
<a
href="Invoices/InvoiceCreate.aspx?AppointmentId=${AppointmentId}">Invoice</a> |
<a href="#" class="cancelLink" data-attr=${AppointmentId}>Cancel</a>
Below is my click function which is under the document ready:
$('a.cancelLink').click(function () {
var appointmentId = $(this).attr("data-attr");
//var appointmentId = $(this).attr("appointmentId");
MemberWebService.AppointmentStatusUpdate(appointmentId, 3, function () {
window.location = 'AppointmentViewAll.aspx';
});
});
Currently code does not enter this click function, how could i achieve this?
No comments:
Post a Comment