There is a javascript function included in the core of mojoPortal that you can call from your own custom javascript to hookup the prompt, you have to pass in the message you want for the prompt. We call it from the onchange event in the editor after checking the editor IsDirty function to make sure content really did change since many things can fire the onchange event in the editor even without real changes.
If you are trying to make the prompt happen for an editor in your custom feature you don't have to write javascript since we already have it built in for the editor, just add this line of server side code in page load:
ScriptConfig.EnableExitPromptForUnsavedContent = true;
if you need to make the prompt happen for other things besides the editor then you need to write your own javascript:
hookupGoodbyePrompt("your prompt message");
Then you have to remember that the save button in your feature that does postback needs to unhook the prompt otherwise it can't postback. You can add code to your button from server side:
using mojoPortal.Web.Framework;
UIHelper.AddClearPageExitCode(btnSave); //unhook the prompt
where btnSave is the server side id of your button.
Hope that helps,
Joe