sabecs
asked on
jQuery - retrieve the href="/user/Jane/" from the previous link
I have a function as below that gives multiple options when a link is clicked.
How can I retrieve the href="/user/Jane/" from the previous link with class="contact-staff-btn" and then set url in "Contact Professional": function() {
How can I retrieve the href="/user/Jane/" from the previous link with class="contact-staff-btn" and then set url in "Contact Professional": function() {
$(function() {
$('.ab-btn').click(function(e) {
e.preventDefault();
var dialog = $('<p>Are you sure you want to cancel?<br/>If you are cancelling within 24 hours please contact professional to advise them of cancellation</p>').dialog({
buttons: {
"Yes, Cancel Appointment": function() {alert('you chose yes');},
"Contact Professional": function() {
window.open('url', 'window name', 'window settings');
return false;
},
"No, Don't Cancel": function() {
dialog.dialog('close');
}
}
});
});
});
<table class="bk-extras">
<tbody>
<tr>
<td colspan="4" style="text-align: left">Wedding Day (Bride) - 1 hour
<br />
<a class="contact-staff-btn" href="/user/Jane/" target="_blank">Contact Jane</a>
</td>
</tr>
</tbody>
</table>
</td>
<td>Jane</td>
<td>April 10, 2017</td>
<td>10:00 AM</td>
<td>A$120.00</td>
<td>Approved</td>
<td>7 King St</td>
<td>3234</td>
<td>
<a class="ab-btn" style="background-color: #000000" href="https://mywebsite.com/wp-admin/admin-ajax.php?action=ab_cancel_appointment&token=912cafdd5d668e094bf40a0f72dff30a">
<span class="ab_label">Cancel</span></a>
</td>
</tr>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome.
ASKER