/* onbeforesave(Boolean continue, String Msg)
Executed when a save has been requested, but before the save is executed.
Param 1: Boolean - If true, continue saving. If false, cancel the save.
Param 2: String - The message that is dispalyed to the user.
*/
function onbeforesave()
{
// prompt the user and capture their response
var success = true;
if (data.alerts.checked)
success = confirm("save ok?");
// execute the response
window.external.beforesavecomplete(success, "beforesavecomplete message");
}
/* onsave(Boolean continue, String Msg)
Executed after a save is executed. This is mainly used to display a message
to the user after a save operation.
Param 1: Boolean - Ignored.
Param 2: String - The message that is dispalyed to the user.
*/
function onsave()
{
// display the same complete message
window.external.savecomplete(true, "save complete message");
}
/* onclose(Boolean continue, String Msg)
Executed when a close is requested. This is mainly used to display a message
to the user after a close operation.
Param 1: Boolean - Ignored.
Param 2: String - The message that is dispalyed to the user.
*/
function onclose()
{
// display the same complete message
window.external.closecomplete(true, "close complete message");
}
/* oncancel(Boolean continue, String Msg)
Executed when a close has been requested, but before the closed is executed.
Param 1: Boolean - If true, continue closing. If false, cancel the close.
Param 2: String - The message that is dispalyed to the user.
*/
function oncancel()
{
// prompt the user and capture their response
var success = true;
if (data.alerts.checked)
success = confirm("close without saving?");
// execute the response
window.external.cancelcomplete(success, "cancelcomplete message");
}
var currentCId = window.external.Incident.CId;
/* ondataupdated(String ObjName)
Executed when data is updated in the current workspace.
Param 1: String - The name of the...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.