I have a repeater in an ASP.NET UpdatePanel as follows;
<asp:UpdatePanel ID="rptGalleries" runat="server">
<ContentTemplate>
<asp:Repeater ID="rptAddPhotoGalleries" runat="server">
<ItemTemplate>
<div>
<input type="checkbox" id="chkNews" data-newsid='<%# Eval("NewsID") %>' runat="server" onclick="javascript:markNews($(this).data('newsid'));" />
</div>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
And I use the following javascript within the element of the HTML;
<script type="text/javascript">
$(document).ready(function () {
function markNews(nID) {
var $span = $('span[data-newsid="' + nID + '"]')
$span.hide('slow');
}
});
</script>
when I click on the resulting checkbox, I get an error in the console as follows;
ReferenceError: markNews is not defined
javascript:markNews($(this).data('newsid'));
Anyone have any ideas?