...

View Full Version : capturing events w3c dom and xhtml



mswitzer
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:

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

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

mswitzer
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum