This is my JavaScript:
$(document).ready(function () {
function ShowHelp() {
window.open('../WebHelp/' + '<%= SessionManager.CurrentDictionaryId %>' + '/mweb.htm#cshelp/assetsdetail.htm', '', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}
function RunPrint(values) {
window.open('../Reports/Assets/AssetProfile.aspx?id=' + values, '', 'toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}
});
And I have two <asp:Hyperlink> tags set like this:
<asp:HyperLink ID="lnkHelp" runat="server" EnableViewState="False" ImageUrl="~/Images/Help.png"
NavigateUrl="javascript:ShowHelp();" />
<asp:HyperLink ID="lnkPrint" ImageUrl="~/Images/PrintMed.png" runat="server" EnableViewState="false"
NavigateUrl="javascript:GetSelectedToPrint();" />
When running the debugger tools in Chrome I get the message:
"Uncaught ReferenceError: ShowHelp is not defined"
"(anonymous function)"
I am fairly ignorant in javascript, but I feel like I know enough to read what is there and i don’t see the issue.
did you try to remove the $(document).ready(function(){ ?
that code is not needed if you are just wanting to create a function that will be fired after the controls were loaded (which is in your case).