Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Window.close overriding in java script

Window.close overriding in java script

Scheduled Pinned Locked Moved JavaScript
c++javatoolshelp
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tahir Tamboli
    wrote on last edited by
    #1

    I want to override window.close native function to perform my own operation before window close. Window.close overriding is not working in IE-10 and IE-9 in Standard mode without compatibility mode. Window.close overriding working in compatibilty mode. Please help. :)

    Thanks Tahir.

    J 1 Reply Last reply
    0
    • T Tahir Tamboli

      I want to override window.close native function to perform my own operation before window close. Window.close overriding is not working in IE-10 and IE-9 in Standard mode without compatibility mode. Window.close overriding working in compatibilty mode. Please help. :)

      Thanks Tahir.

      J Offline
      J Offline
      Joezer BH
      wrote on last edited by
      #2

      You might want to try jQuery's unload:

      $(window).unload(function()
      {
      //...
      });

      Cheers, Edo

      It is a paradox that paradoxes would actually exist in reality. That means of course that they don't exist. However, they do!

      ∫(Edo)dx = Tzumer ∑k(this.Kid)k = this.♥

      T 1 Reply Last reply
      0
      • J Joezer BH

        You might want to try jQuery's unload:

        $(window).unload(function()
        {
        //...
        });

        Cheers, Edo

        It is a paradox that paradoxes would actually exist in reality. That means of course that they don't exist. However, they do!

        ∫(Edo)dx = Tzumer ∑k(this.Kid)k = this.♥

        T Offline
        T Offline
        Tahir Tamboli
        wrote on last edited by
        #3

        Thanks Edo For your rply, But i have used window.close in several places in my product so need to override window.close.

        J 1 Reply Last reply
        0
        • T Tahir Tamboli

          Thanks Edo For your rply, But i have used window.close in several places in my product so need to override window.close.

          J Offline
          J Offline
          Joezer BH
          wrote on last edited by
          #4

          You are most welcome, did it work?

          It is a paradox that paradoxes would actually exist in reality. That means of course that they don't exist. However, they do!

          ∫(Edo)dx = Tzumer ∑k(this.Kid)k = this.♥

          T 1 Reply Last reply
          0
          • J Joezer BH

            You are most welcome, did it work?

            It is a paradox that paradoxes would actually exist in reality. That means of course that they don't exist. However, they do!

            ∫(Edo)dx = Tzumer ∑k(this.Kid)k = this.♥

            T Offline
            T Offline
            Tahir Tamboli
            wrote on last edited by
            #5

            It works but i want to close the window by overriding window.close. Please suggest anything else. Thanks :-)

            T 1 Reply Last reply
            0
            • T Tahir Tamboli

              It works but i want to close the window by overriding window.close. Please suggest anything else. Thanks :-)

              T Offline
              T Offline
              twseitex
              wrote on last edited by
              #6

              Only one way function close is a pre-defined property of window object. Please use event bubbling of close() and window. Insert a new funktion that recives this event what you want (event handler). Prototyping of a function ... try it. events of window (IE) Event Description onactivate Fires when the object is set as the active element. onafterprint Fires on the object immediately after its associated document prints or previews for printing. onbeforedeactivate Fires immediately before the activeElement is changed from the current object to another object in the parent document. onbeforeprint Fires on the object before its associated document prints or previews for printing. onbeforeunload Fires prior to a page being unloaded. onblur Fires when the object loses the input focus. oncontrolselect Fires when the user is about to make a control selection of the object. ondeactivate Fires when the activeElement is changed from the current object to another object in the parent document. onerror Fires when an error occurs during object loading. onfocus Fires when the object receives focus. onhelp Fires when the user presses the F1 key while the browser is the active window. onload Fires immediately after the browser loads the object. onmove Fires when the object moves. onmoveend Fires when the object stops moving. onmovestart Fires when the object starts to move. onresize Fires when the size of the object is about to change. onresizeend Fires when the user finishes changing the dimensions of the object in a control selection. onresizestart Fires when the user begins to change the dimensions of the object in a control selection. onscroll Fires when the user repositions the scroll box in the scroll bar on the object. onunload Fires immediately before the object is unloaded. methods of window (IE) Method Description alert Displays a dialog box containing an application-defined message. attachEvent Binds the specified function to an event, so that the function gets called whenever the event fires on the object. blur Causes the element to lose focus and fires the onblur event. clearInterval Cancels the interval previously started using the setInterval method. clearTimeout Cancels a time-out that was set with the setTimeout method. close Closes the current browser window or HTML Application (HTA). confirm Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons. createPopup Creates a popup wind

              T 2 Replies Last reply
              0
              • T twseitex

                Only one way function close is a pre-defined property of window object. Please use event bubbling of close() and window. Insert a new funktion that recives this event what you want (event handler). Prototyping of a function ... try it. events of window (IE) Event Description onactivate Fires when the object is set as the active element. onafterprint Fires on the object immediately after its associated document prints or previews for printing. onbeforedeactivate Fires immediately before the activeElement is changed from the current object to another object in the parent document. onbeforeprint Fires on the object before its associated document prints or previews for printing. onbeforeunload Fires prior to a page being unloaded. onblur Fires when the object loses the input focus. oncontrolselect Fires when the user is about to make a control selection of the object. ondeactivate Fires when the activeElement is changed from the current object to another object in the parent document. onerror Fires when an error occurs during object loading. onfocus Fires when the object receives focus. onhelp Fires when the user presses the F1 key while the browser is the active window. onload Fires immediately after the browser loads the object. onmove Fires when the object moves. onmoveend Fires when the object stops moving. onmovestart Fires when the object starts to move. onresize Fires when the size of the object is about to change. onresizeend Fires when the user finishes changing the dimensions of the object in a control selection. onresizestart Fires when the user begins to change the dimensions of the object in a control selection. onscroll Fires when the user repositions the scroll box in the scroll bar on the object. onunload Fires immediately before the object is unloaded. methods of window (IE) Method Description alert Displays a dialog box containing an application-defined message. attachEvent Binds the specified function to an event, so that the function gets called whenever the event fires on the object. blur Causes the element to lose focus and fires the onblur event. clearInterval Cancels the interval previously started using the setInterval method. clearTimeout Cancels a time-out that was set with the setTimeout method. close Closes the current browser window or HTML Application (HTA). confirm Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons. createPopup Creates a popup wind

                T Offline
                T Offline
                Tahir Tamboli
                wrote on last edited by
                #7

                Thanks twseitex:-) . i ll try n let u knw .

                1 Reply Last reply
                0
                • T twseitex

                  Only one way function close is a pre-defined property of window object. Please use event bubbling of close() and window. Insert a new funktion that recives this event what you want (event handler). Prototyping of a function ... try it. events of window (IE) Event Description onactivate Fires when the object is set as the active element. onafterprint Fires on the object immediately after its associated document prints or previews for printing. onbeforedeactivate Fires immediately before the activeElement is changed from the current object to another object in the parent document. onbeforeprint Fires on the object before its associated document prints or previews for printing. onbeforeunload Fires prior to a page being unloaded. onblur Fires when the object loses the input focus. oncontrolselect Fires when the user is about to make a control selection of the object. ondeactivate Fires when the activeElement is changed from the current object to another object in the parent document. onerror Fires when an error occurs during object loading. onfocus Fires when the object receives focus. onhelp Fires when the user presses the F1 key while the browser is the active window. onload Fires immediately after the browser loads the object. onmove Fires when the object moves. onmoveend Fires when the object stops moving. onmovestart Fires when the object starts to move. onresize Fires when the size of the object is about to change. onresizeend Fires when the user finishes changing the dimensions of the object in a control selection. onresizestart Fires when the user begins to change the dimensions of the object in a control selection. onscroll Fires when the user repositions the scroll box in the scroll bar on the object. onunload Fires immediately before the object is unloaded. methods of window (IE) Method Description alert Displays a dialog box containing an application-defined message. attachEvent Binds the specified function to an event, so that the function gets called whenever the event fires on the object. blur Causes the element to lose focus and fires the onblur event. clearInterval Cancels the interval previously started using the setInterval method. clearTimeout Cancels a time-out that was set with the setTimeout method. close Closes the current browser window or HTML Application (HTA). confirm Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons. createPopup Creates a popup wind

                  T Offline
                  T Offline
                  Tahir Tamboli
                  wrote on last edited by
                  #8

                  please, if possible can you give the example.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups