Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    capturing events w3c dom and xhtml

    I have a question, and feel extremely STUPID, because I used to be an extremely good scripter, but haven't created anything in three years, and have not familiarized my self with the W3C DOM.

    Now I am creating a new site (XHTML Strict - yes it validates), which requires pop up windows. Problem is, nothing I put into onclick attributes in my anchor tags triggers anything. Not even onclick="self.close()"

    Now my question is -
    Do all events need to be set up to be captured to prompt event handlers etc in script, not in xhtml?

    Why doesn't <a href="blah" onclick="self.close()">blah</a> work?

    Am I just an idiot?

    No, don't answer that last one...

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Try
    Code:
    window.self.close()
    if that doesn't work, post all your code (including HTML).

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Perhaps the browser doesn't allow scripting to close windows. What you posted is completely fine.

  • #4
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep, I'm dumb... it was a cached old version of the page, before I put in the javascript, which is why it wasn't working. Much obliged.

    I had refreshed a ton, guess FireFox takes a long time for cache to clear.


  •  

    Posting Permissions

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