I've implemented some JavaScript code in my Oracle APEX application to create global hotkeys. The code works perfectly in one of my applications but fails in another, showing an error in the browser's console. Below is the JavaScript code I've added to both applications:
$(document).ready(function() {
console.log('run');
apex.actions.add({
name: 'myGlobalAction',
label: 'My Global Action',
action: function() {
console.log('Global action triggered!');
$('a[href*="hot_key_test"]').trigger('click');
},
shortcut: 'Ctrl+Shift+Q'
});
apex.actions.add({
name: 'myHelpAction',
label: 'My Help Action',
action: function() {
$("[data-id=pageHelp]").click();
},
shortcut: 'Ctrl+Shift+H'
});
});
showing following error
