hi,

i cannot read the "onClick" property, but i can set it!

here is my testcode which does NOT work:

<html>
<body>
<script>
function dummy () {
  alert('dummy')
}
</script>

  <a href="" onClick="dummy();return false">[Dummy]</a>

<script language="JavaScript">

function clickHook (p) {
  alert('hook'+p)

  if (p.oldHandler != null) return p.oldHandler()
  return true;
}

var f = new Function ("return clickHook(this)")

alert(document.links[0].onclick)
document.links[0].oldHandler = document.links[0].onclick
document.links[0].onclick=f

</script>
</body>
</html>

when running this page, you first get a messagebox with a "undefined" -->
the "document.links[0].onclick" is undefined. but the assignment
"document.links[0].onclick=f" works fine. the only problem i have is that i
don't have the oldHandler :-(

my question: is it a known bug that i cannot read functionproperties or are
there bugs in my code?

thanx
ulrich schreiner




Reply via email to