<a id="aViewShortList" href="#" data-jobid="<%=Request.QueryString["jobid"]%>" class="viewAddJob">
<img src="images/JobsModule/fav_blank.png"></img>Add to ShortList
</a>
$('#aViewShortList').click(function () {
$.ajax({
url: '/DesktopModules/JobsModule/api/lists/saveuserjob',
type: 'POST',
data: { JobId: jobId, UserId: userId, PortalId: portalid },
beforeSend: $.dnnSF().setModuleHeaders,
success: function () {
alert('done');
document.getElementById("aViewShortList").innerHTML = "<img src=\"images/JobsModule/fav.png\"></img>ShortListed";
},
error: function (xhr, textStatus, errorThrown) {
alert(JSON.parse(xhr.responseText).Message);
alert(textStatus);
alert(errorThrown);
},
});
});