Trigger Javascript when closing browser window from CP8

I worry this isn't possible but here goes....any help would be incredible.
Recently I was given some great advice on how to trigger a Javascript action in the frame on our LMS which the Captivate file plays in.
It works perfectly and on the final page triggers the Javascript which send usage back to the LMS and forward the user to a page which allows them to rate the course.
The code was as follows:
top.code.closeSCOContent();
closeSCOContent() is something written into our LMS.
However the obvious issue occurs when a user just closes the browser window and for some reason our LMS doesn't record any bookmarking or any data.
The only way it seems to do this is if that function is called.
So using the window.onunload() or the DOFinish; function is there a way I can edit any file in the Captivate output to trigger this function when closing the browser?
Long shot I know but currently the best I have managed is getting the course to trigger this as soon as it loads rather than closing the window?
Massive thanks in advance for any advice.

Any solution to ensure the data is written back to the LMS would solve the issue.
Currently when the close button is pressed nothing happens at all and it's a big problem.
Triggering this .closeSCOContent() function would be the ideal, but if it's not possible anything to write back would be best.
When you say <body onbeforeunload="top.code.closeSCOContent();">
Do you mean putting this in the HTML file of the output which currently is:
<body bgcolor="#f2f2f2">
and change this to:
<body onbeforeunload="top.code.closeSCOContent();" body bgcolor="#f2f2f2">

Similar Messages

  • Popup to confirm when closing browser window?

    Hi
    I want to display popup confirm window when closing browser window, "changes will be lost" yes or no. for this i searched forums got some idea, about "WORK PROTECT MODE". this will work only when our application running from portal. my doubt is where should i write code for this??? any help
    Thanks,
    kris.

    Hi Thomas,
    We are on ECC6.0 enph5.
    In system configuration in epc.loader(service) the value for work protect mode is set as 1 - Protect unsaved data (open page in a new window) 
    1)Is it possible to override this value within WD ABAP application? for example show popup window when there is unsaved data
    2)In this scenario what is the significance of L_PORTAL_MANAGER->SET_WORK_PROTECT_MODE
    and   L_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG
    3)Where exactly  L_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG has to coded. It does trigger modify method of the view.
    Thanks,
    chamu

  • How to show a confirmation when closing browser window in jdeveloper11g

    Hi
    I'm Using Jdev 11g
    How to show a confirmation when closing browser window in jdeveloper11g
    Regards
    Abhilash

    Abhilash,
    My goodness...
    Didn't search the forum, eh? In fact, didn't even look at the last 5 or 6 posts - this was posted by another user within the past few hours.... Giving a message while closing a jspx page.
    John

  • Closing browser window from Flash movie on CD

    I have to put a flash lesson I created on a cd for a client and while testing it I noticed that my exit button in the movie no longer seems to function.
    This is my close window function
        function closeWindow(evt:Event)
            var url:String = "javascript:window.opener=self; window.close()";
            var request:URLRequest = new URLRequest(url);
            try
                navigateToURL(request, "_self");
            catch (e:Error)
                trace("Error occurred!");
    Can anyone tell me why this wouldn't work when the movie is launched in a browser window from a CD?

    Fi it is at all possible you cannot do that with url request.
    Try using ExtrenalInterface class:
    ExternalInterface.call("javascript:...");
    It may not waork though depending on security settings and embed parameters.

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Problem in Closing Browser window from an Applet.

    I have wriiten a small Applet progarm that calls a Javascript function in the opening window, to close the window in which it is loaded.The Applet window is a PopUp window from one of my application's window.
    First time I start my application and load that Applet and then close the frame window,it works fine that the browser window will close, when the frame window is closed.It calls the window closing event in that applet stop method is called and In stop methd a closeLaunchedBrowser method will called this has a Javascript method and the Method closes the window using the self.close() method.
    But now if I continue this process of launching applet and then closing frame window, initial 1 or 2 steps it has know problem when I continue this, after 3 or 4 steps, it result in browser hang/crash.
    I am using java version 1.4.2_01 or higher and IE or Firefox(any other NetScape based) browser to load applet.It works fine with IE but getting problem in case of Firefox(any other NetScape based).
    The error dialog information and related event log generated is shown below :
    The dialog which is displayed before crashing of firefox has information :
    "firefox.exe has generated errors and it will closed by windows.you will need to restart the program.
    An error log is being created."
    The error log information :
    Source : Browser Event ID: 8032
    "The browser service has failed to retrieve the backup list too many times on transport \Device\NetBT_Tcpip_{611A64A2-8F4B-409E-9AB2-0D9BF741E791}. The backup browser is stopping.
    The code related to this is given below.
    import javax.swing.JApplet;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import netscape.javascript.JSObject;
    public class TestApplet extends JApplet {
    protected JSObject win = null;
    private JFrame frame = null;
    private boolean alreadyClosed = false;
    public void init(){
    this.win = JSObject.getWindow(this);
    frame = new JFrame("Test Frame");
    frame.setSize(300, 400);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
    TestApplet.this.stop();
    frame.show();
    public void stop() {
    if (!alreadyClosed) {
    alreadyClosed = true;
    closeLaunchedBrowser();
    System.gc();
    System.runFinalization();
    private void closeLaunchedBrowser() {
    final TestApplet thisObject = this;
    Runnable r = new Runnable() {
    public void run() {
    try {
    JSObject win = (JSObject)JSObject.getWindow(thisObject);
    if (win != null && win.toString() != null) {
    //win.eval("top.opener=self;self.close();");
    //win.call("close", null);
    win.eval("self.close();");
    } catch (Exception e) {
    Thread t = new Thread(r);
    t.start();
    }If any one know solution regarding how to aviod this crash of browser please let me know. I will be very thankful to you.
    Thanks.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Prompting users for confimation when closing browser window

    Hi All,
    I would like to prompt the user with a popup-screen asking for confirmation that he wants to close the browser when hitting the browser-close ('X') button. Is this possible ?
    If the user chose to cancel the browser window shoud remain open, with all content as it was... and of course if he chooses to continue the window should just close.
    the WDA app is straight forward, and not running inside the portal.
    Thanx in advance
    -Tonni

    Hi Tonni,
    I thought I should add - the portal does implement a work protection mode that does allow you to prompt users if they navigate away from your page - and one of the best ways to implement that is through the FPM and its work protect mode interface.
    However, that still doesn't help, I'm afraid, in the case where you're trying to stop the user closing the browser window...
    I should also point out that some browsers do indeed produce an event which can be trapped on close of the window, and have been hugely exploited by website designers - to the extent that later/better versions no longer support it. Remember the web pages that when you closed spawned 3 more, and those 3 more etc. etc.
    Cheers,
    Chris
    edit:  also worth pointing out that the "Close" button provided within a portal session by the FPM is a form of navigation and can be trapped. Likewise any internal navigation button that perform the same sort of thing within your app.
    Edited by: Chris Paine on Mar 29, 2010 3:08 PM

  • How do I open a new browser window from Flash

    I wish to open a new browser window from Flash and when the new window closes to return to the location from whence I started.
    ThomasChen

    The command to open a new window would be the "_blank" part of a command to link to a web page in the code below.
    navigateToURL(new URLRequest("http://www.anothersite.com", "_blank"));
    As far as the new window closing and getting back to where you were in the original window, I don't understand where that original window might have gone to... You should be wherever you last left it.

  • Open new browser window from a JApplet

    Hi,
    I want to open a new browser window from a JApplet.My first thought was to use the Live Connect technology but it worked only with simple applets not with JApplets.Then i tried it by getting the Applet context (getAppletContext() method) but it still didn't work with JApplet...(it worked with Applet).I believe it has something to do with the applet security but i haven't yet figured it out.
    For example when i call the getAppletContext() method from a JApplet i get an java.security.AccessControlException ... .Thanks

    I must correct myself now :).
    The getAppletContext() method does work with JApplets too.Still , i have problems with the Live connection alternative.It seems that it by importing the netscape.javascript package i get the security eror that i mention above...

  • When closing Firefox windows, I would like a warning before the last window closes. The about:config settings do nothing. There is a warning for multiple tabs..

    When closing Firefox windows, I would like a warning before the last window closes. The about:config settings do nothing. There is a warning for multiple tabs... why not for the last window? I do not use tabs... just windows... I have a mouse button programmed for that. It is really irritating to have to restart Firefox all the time and then open the history window because no warning was issued!

    This is ridiculous. I've had this problems for years now and I'm finally walking away from Firefox. I use my keyboards more than my mouse, and how many times does your finger slip and hit Command Q instead of W. How come FF can't reset something as trivial as this? So many people are having problems with this?
    Feels like FF has become too big, too slow and just not cooperative anymore. What a shame, I've been using Netscape/Firefox for 13 years. This is silly.

  • New browser window from uix

    How can I open a new browser window from an event handler in UIX?
    Thanks in advance,
    Martmn Patrici

    I just tried your suggestion. Unfortunately, it did not work. Here's the UIX code I used:
    <tableSelection>
    <singleSelection model="${bindings.MPOOrdersView1Iterator}" text="Select">
    <primaryClientAction>
    <firePartialAction targets="_uixState MplistsView11" source="MPOOrdersView10" event="select"/>
    </primaryClientAction>
    <contents>
    <submitButton formName="mlrhomeform" text="Print Lists" event="print" />
    <submitButton text="View Merge Reports" event="mergerpts" formName="mlrhomeform" targetFrame="_blank"/>
    </contents>
    </singleSelection>
    </tableSelection>
    The only difference from the original code is the addition of the targetFrame="_blank" in the submitButton.
    It had no effect. My redirected page showed up in the same browser window. This left me with an expired page when I press the Back button on the browser.
    My assumption is the response.sendRedirect() call wipes out the targetFrame setting.
    Does anyone know how the browser (Internet Explorer in this case) actually gets notified to open a new window? There's got to be something that the targetFrame="_blank" sets up to cause it.
    I know that Netscape supports a "Window-target:" header, but unfortunately IE doesn't. Is there some "standard" header that I can put in a response.addHeader() call that would tell all browsers to open a new window?
    Of course, a UIX solution would be preferrable!
    Any other ideas?

  • How can I open a new browser window from UIX?

    I need to open a new browser window from an event handler. How that can be done? HELP!
    Thanks!
    Martin Patrici

    HTML doesn't really let you do this on the server side; the client is in charge
    of creating new windows, not the server.
    If you know that clicking a certain link/button, etc. will always raise a new window,
    then you should use Javascript or "targetFrame" accordingly.
    If the decision will only be made on the server side, then you could reload the current
    window, only this time use an "onLoad" on the <body> to raise a window.

  • Close a browser  window from a servlet

    I am newbie and am trying to close the browser window from my servlet without prompting as my servlet is designed to run as a batch app.
    The servlet is invoked by a scheduling agent and performs the batch function , but leaves the browser window open . I
    need help
    Thanks
    VK

    I am newbie and am trying to close the browser
    window from my servlet without prompting as my
    servlet is designed to run as a batch app.
    The servlet is invoked by a scheduling agent and
    performs the batch function , but leaves the browser
    window open .I don't see the problem with that. The users can easily close the browser if they want to. It's possible that some Javascript could be used to close the browser window but it's user-unfriendly and shouldn't normally be done.

  • Invalidate session when closing browser

    Hi All,
    Please anybody help me regarding session invalidate in servlet(web application) when closing browser.
    how can do this.
    Thanks,

    It can't be done in pure servlet because browser closing event is not caught be servlet. Google for JavaScript's onBeforeUnload event and invoke Ajax call to invalidate the session - this is the only way to handle this.

  • When user browses away from my html

    Like most of the use of swf, my swf is embedded in an html.
    I'm wondering if I can catch the event in my swf when user browses
    away from the html. Is swf gets unloaded at the time? Can I do
    certain things in actionscript when it happens?
    Help is appreciated.
    thanks,
    Ted

    Hi Ted,
    Tough to say how much you will be able to do as the URL is
    changing,
    but I believe JavaScript has some function like "onUnload"
    that you can
    use. You can then use the fscommand-style call to invoke a
    function in
    your Flash movie to let it now it's about to be gone.
    I haven't tried this though so I don't know how effective it
    is.
    Patrick
    nehcdet wrote:
    > Like most of the use of swf, my swf is embedded in an
    html. I'm wondering if I
    > can catch the event in my swf when user browses away
    from the html. Is swf
    > gets unloaded at the time? Can I do certain things in
    actionscript when it
    > happens?
    >
    > Help is appreciated.
    >
    > thanks,
    > Ted
    >
    http://www.baynewmedia.com
    Faster, easier, better...ActionScript development taken to
    new heights.
    Download the BNMAPI today. You'll wonder how you ever did
    without it!
    Available for ActionScript 2.0/3.0.

Maybe you are looking for

  • Java SSO Partner application

    Hello, I configured and deployed a Java Partner Application as specified in the demo (ssosdk902.zip). I created an OC4J container and deployed all beans and jsp pages. When I try to access papp.jsp page, it presents me with sso login page but when i

  • How can i make something in dreamweaver stay in fixed position?

    Hey guys, I'm having a really hard time getting the css right on this one, perhaps someone can see what I'm missing. If you go to my website http://www.vickybonline.com and scroll down to the bottom of the page, you can see I have set up a few rss fe

  • Creating photo slideshow in imovie without any effects

    Hi, When I am trying to make a photo slide-show video in imovie, every photo comes with zoom-in and out effect. I dont like that one. I just want to show photos one after another without any effect. But I couldnt find any option in imovie. Is it poss

  • 19 inch or 22 inch external display?

    I have a black Macbook (older generation). I'm looking into buying the Acer H213H as an external display (21.5 inch LCD). Before I buy it, I'd like to know if external displays with higher native resolutions than the Macbook will show fuzzier text/im

  • Part of web address

    I must not be typing it in right, but here's what I need to know. I need part of the web address after the HTTP_HOST segment. For example: www.example.com/images/test.gif. What I need is /images/test.gif. Thanks