View Full Version : capturing events w3c dom and xhtml

01-20-2005, 01:12 AM
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... :thumbsup:

01-20-2005, 02:18 AM
window.self.close()if that doesn't work, post all your code (including HTML).

01-20-2005, 02:19 AM
Perhaps the browser doesn't allow scripting to close windows. What you posted is completely fine.

01-20-2005, 06:50 PM
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.