Announcement

Collapse
No announcement yet.

Close window button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Close window button

    I want to add a "close window" button to an html page within my site.
    Not being java literate, I have searched the web which seems to come up with:

    <FORM>
    <INPUT TYPE="BUTTON" VALUE="CLOSE WINDOW" ONCLICK="JAVASCRIPT:WINDOW.CLOSE();">
    </FORM>

    I get the button but nothing else happens.

    What am I missing?

    Graham
    Graham

    ___________________________________

    www.Briggsbits.co.uk
    The online store for Briggs and Stratton spare parts

    #2
    Ah, just tried it with the term "window.close" in lower case and it seems to work. )Allbeit with an annoying windows warning that the page wants to close).

    Is this java stuff case sensitive then?
    Graham

    ___________________________________

    www.Briggsbits.co.uk
    The online store for Briggs and Stratton spare parts

    Comment


      #3
      Most things (object, properties, methods) in javascript are case sensitive.

      Also, that box will always pop-up when using window.close() unless the window itself was opened with a javascript command.
      www.gbradley.co.uk
      Web Development, Actinic Patches, Scripts & more

      Comment


        #4
        So, if I wanted to get rid of that, I take it that there is a corresponding command window.open() or something to use as the link.

        All this stuff is just starting to make a bit of sence to me now.

        Have all browsers got the same understanding of these basic java commands?
        Graham

        ___________________________________

        www.Briggsbits.co.uk
        The online store for Briggs and Stratton spare parts

        Comment


          #5
          Now there's a thing.

          I've just uploaded the changes and I don't get the pop up warning when using the button online.
          Graham

          ___________________________________

          www.Briggsbits.co.uk
          The online store for Briggs and Stratton spare parts

          Comment


            #6
            The error is due to you just having the pop up window open and then trying to close - when you open from the website the original page stays open in the background and when you close the pop-up you no longer receive the message.


            Bikster
            SellerDeck Designs and Responsive Themes

            Comment


              #7
              Which, apologies to Kermy, is what he said but in a more technical version that I did


              Bikster
              SellerDeck Designs and Responsive Themes

              Comment

              Working...
              X