www.webdeveloper.com
Results 1 to 15 of 15

Thread: Javascript Close Problem.

  1. #1
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Javascript Close Problem.

    Hi,
    This is my first post - looks cosy here.

    Can anyone help me with this small script. I am a complete novice.

    It did work one time, and still does with Internet explorer.

    I normally use Netscape 7.1. And it does nothing when clicked except the progress bar moves to the end and stops.

    I use it to close a page that I use for links on my PC only.

    <td valign="top"><a href="javascript:top.close()">Close Window</a>

    javascript:smilie('')
    Kind Regards
    Art.
    UK.

  2. #2
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335
    Try window.close() instead of top.close().

  3. #3
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Question

    Hi,
    I have tried that previously and it did not work, I tried it again as you suggested and no it still won't work.

    Sigh

    I have some idea that it is somthing to do with Javasoft on my PC - is this possible.

    Art.

    Originally posted by cijori
    Try window.close() instead of top.close().
    Kind Regards
    Art.
    UK.

  4. #4
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Have you tried using:

    <a href="#" onclick="window.close();return false;">Close Window</a>
    Every fight is a food fight when you’re a cannibal.

  5. #5
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Originally posted by mulgravia
    I have some idea that it is somthing to do with Javasoft on my PC - is this possible.
    Check to make sure javascript is enabled in your browser:

    Edit -> Preferences -> Advanced -> Scripting and Plugins

    Then, make sure javascript is enabled for Navigator.

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  6. #6
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8
    I had already checked that - checked again and it is enabled.

    Thank's
    Art

    Originally posted by pyro
    Check to make sure javascript is enabled in your browser:

    Edit -> Preferences -> Advanced -> Scripting and Plugins

    Then, make sure javascript is enabled for Navigator.
    Kind Regards
    Art.
    UK.

  7. #7
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Question

    Hi,
    Tried it but makes no difference.

    Just like my original - it works with IE 5 but not with Netscape 7.1

    Thanks
    Art.
    UK


    Originally posted by lavalamp
    Have you tried using:

    <a href="#" onclick="window.close();return false;">Close Window</a>
    Kind Regards
    Art.
    UK.

  8. #8
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Well I've got Netscape 7.1, so if you upload it I'll check to see if it works on my version.
    Every fight is a food fight when you’re a cannibal.

  9. #9
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Question

    Hi Lavalamp

    Thanks for your help, but I am not sure what you are asking me to do when you say "upload it". Upload to where ??

    Here is the script, but it would have to go into a HTML Page of course to check it.

    <a href="javascript:top.close()">Close Window</a>

    I know it does work with Netscape 7.1, because it was working originally. then stopped for no apparent reason.

    I am English too, a "Geordie" living in Tyneside, where are you ?

    Regards
    Art.


    Originally posted by lavalamp
    Well I've got Netscape 7.1, so if you upload it I'll check to see if it works on my version.
    Kind Regards
    Art.
    UK.

  10. #10
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    I live in Manchester so by definition I'm a football hooligan thug.
    By upload I mean either copy and paste the code for your page into a new post or save your source as a .txt and attach it to I post (I'd prefer that one).

    When you get something from the internet and put it on your computer, that's called downloading, so when you do it the other way it's called uploading.
    Every fight is a food fight when you’re a cannibal.

  11. #11
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Question

    Hi,
    I know what download and upload means - I built my own website. My source contains 35 pages and 6 folders, containing private information (inluding on-line banking) which I use on my PC as a link directory file. So as you see I cannot upload any pages.

    As it is now proven that, there is nothing wrong with my script, it works with Internet Explorer, so the problem must be with Netscape and/or Javascript itself.

    Thank's for the help anyway,

    Art.







    Originally posted by lavalamp
    I live in Manchester so by definition I'm a football hooligan thug.
    By upload I mean either copy and paste the code for your page into a new post or save your source as a .txt and attach it to I post (I'd prefer that one).

    When you get something from the internet and put it on your computer, that's called downloading, so when you do it the other way it's called uploading.
    Kind Regards
    Art.
    UK.

  12. #12
    Join Date
    Jul 2003
    Posts
    8
    Try the following, I have netscape 7.0 and it works fine, as well as in IE 6.0 ...

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

    Hope it helps (and works)
    If it's not broken, don't fix it ... optimize it!

  13. #13
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Question

    Hi,
    The script you suggested is the same as my original.

    As I said, I don't think that is is my script but something else.

    I have ruled out a virus too.

    Thank's for your interest.

    Art.


    Originally posted by manual
    Try the following, I have netscape 7.0 and it works fine, as well as in IE 6.0 ...

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

    Hope it helps (and works)
    Kind Regards
    Art.
    UK.

  14. #14
    Join Date
    Jul 2003
    Location
    United Kingdom
    Posts
    8

    Thumbs up Javascript Window Close Problem Resolved - Thank you all

    Thank you..........

    To all of you who offered help and advice with my JavaScript "Window Close" problem, which is now rectified.

    Because all the script recommendations were similar to my original, I figured the problem must be elsewhere, so I hit on Netscape 7.01 which I reloaded from the CD, on top of the existing installation and thankfully it is now fixed.

    The problem appears to have been that JavaScript was either not properly installed or it was corrupted.

    I hope this may be of help to anyone else who may experience the same problem.

    Thank you all once again
    Art.
    UK.
    Kind Regards
    Art.
    UK.

  15. #15
    Join Date
    Feb 2003
    Location
    Britain
    Posts
    1,335

    Smile

    Glad it works. And welll done for fixing it!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles