I have a widget in my page. If i click on any part of the widget it should navigate to next page which has some details about that widget. I need a dialog to be opened if i click on a span named "likes" available within that widget. But instead it is navigating to the next page even if i click on that link..
It should navigate to next page if i click on any part of the widget except that link..
This is normal code for click:
$('td#' + parentElement).find('div.streamcontenttopmain').click(function() {
window.location.href = 'TaskDetails.aspx?id=' + json_row.id + '&community=' + getQueryParam('community');
});
This code will it navigate to next page if i click anywhere within the widget
My span is defined like this:
<span class="flft likes" style="MARGIN-LEFT: 2px">
This is What i tried:
$('td#' + parentElement).find('div.streamcontenttopmain').click(function (e) {
if ($(this).hasClass("flft likes")) {
alert("hi");
} else {
window.location.href = 'TaskDetails.aspx?id=' +
json_row.id +
'&community=' +
getQueryParam('community');
}
});
thiswill be the div and not the span