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.
$(document).ready.javascript:URI, which uses global functions. By nesting the functions in another function, they are no longer global, and can't get called through said URI.