Results 1 to 10 of 10

Thread: close window

  1. #1
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default close window

    any script that when i put a refresh page script and when page refresh its close the page automatic

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    HTML Code:
    <input type="button" value="Refresh" onclick="location.reload();window.close();">
    Also note that on FF, you cannot close a page when it's not opened by a script.

    Hope that helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    its ask permission to user i want auto close and no button just my page refresh after 30nd and close the window

  4. #4
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Yes. It tends to do that. However, you could make a function that loops to check if the user wants to close the page. If the user says no, the function would loop again, thus trying to close the window. This may be annoying, but for your purpose, I do not know. Ask me for code if you are interested in what I said.

    -magicyte

  5. #5
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    sir i set i page refresh script on the its refresh page after 60nd i want or after 60nd window will close auto when page refresh or its redirect to any other page

  6. #6
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    If this is what you want, it is impossible to accomplish with JavaScript or any client-side script.

    I am truly sorry.

    -magicyte

  7. #7
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    if the client click on refresh the page auto redirect is it passable?

  8. #8
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Quote Originally Posted by mir4kir View Post
    if the client click on refresh the page auto redirect is it passable?
    Code:
    location.href='http://www.google.com'
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  9. #9
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    this code nt working
    \

  10. #10
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Then probably, there's something wrong on how you set it up.

    For further reading:
    http://www.w3schools.com/htmldom/prop_loc_href.asp
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •