using close window buttons on a refreshed page

Discussion in 'Javascript' started by mcyi2mr3@lycos.co.uk, Nov 1, 2005.

  1. Guest

    Hi all

    I'm new to javascript and im trying to add a close button function to
    my certain pages of my site. I use this code:

    <a href='javascript:window.close();'>Close Window</a>

    to create a hyperlink which closes the window. However with pages which
    display data retrieved from a database using PHP i use a form to submit
    a search on the page which displays results. At the bottom of the page
    is the close window link, however it fails to work once a form has been
    submitted on the page. It only works when the page first loads.

    Any ideas guys on how i can get a close window option that works on my
    results page after submitting a search?

    Marc
     
    , Nov 1, 2005
    #1
    1. Advertising

  2. Randy Webb Guest

    said the following on 11/1/2005 3:39 PM:

    > Hi all
    >
    > I'm new to javascript and im trying to add a close button function to
    > my certain pages of my site. I use this code:
    >
    > <a href='javascript:window.close();'>Close Window</a>
    >
    > to create a hyperlink which closes the window. However with pages which
    > display data retrieved from a database using PHP i use a form to submit
    > a search on the page which displays results. At the bottom of the page
    > is the close window link, however it fails to work once a form has been
    > submitted on the page. It only works when the page first loads.
    >
    > Any ideas guys on how i can get a close window option that works on my
    > results page after submitting a search?


    <H1>To close this page, click the X in the upper right corner</H1>

    Users know how to use the browser and it's built in mechanisms, stop
    trying to reinvent the wheel and your problem will go away.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices -
    http://www.mattkruse.com/javascript/bestpractices/
     
    Randy Webb, Nov 1, 2005
    #2
    1. Advertising

  3. Guest

    But still the unanswered question looms large in my mind, why does the
    javascript not work when the webpage form is submitted?
     
    , Nov 1, 2005
    #3
  4. Randy Webb Guest

    said the following on 11/1/2005 5:29 PM:

    Please quote what you are replying to.

    If you want to post a followup via groups.google.com, don't use the
    "Reply" link at the bottom of the article. Click on "show options" at
    the top of the article, then click on the "Reply" at the bottom of the
    article headers.

    > But still the unanswered question looms large in my mind, why does the
    > javascript not work when the webpage form is submitted?
    >


    Who knows, without seeing a bare minimum sample page that displays the
    behavior you describe, it is impossible to even guess.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Answer:It destroys the order of the conversation
    Question: Why?
    Answer: Top-Posting.
    Question: Whats the most annoying thing on Usenet?
     
    Randy Webb, Nov 1, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    8,837
    sateeshranga
    Aug 7, 2008
  2. Iñaki Baz Castillo
    Replies:
    7
    Views:
    864
    Iñaki Baz Castillo
    Jan 12, 2010
  3. Diana
    Replies:
    1
    Views:
    134
    Diana
    Apr 6, 2004
  4. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    377
    Gérard Talbot
    Sep 2, 2005
  5. Replies:
    4
    Views:
    245
Loading...

Share This Page