I have the following code:
var ocevent = function(v)
{
alert('javascri pt event: u clicked '+v);
return false;
};
var items = {
"002.jpg": {text:"002", href:"#", click:function( ){return ocevent(2)} },
"003.jpg": {text:"003", href:"#", click:function( ){return ocevent(3)} },
....}
And I use the following code to assign the click property to onclick of
anchor.
a.setAttribute( 'onclick', items[id].click);
However, the code works well in IE but not in Mozilla Firefox. To test the
code go to:
Any suggestion for function pointers?
var ocevent = function(v)
{
alert('javascri pt event: u clicked '+v);
return false;
};
var items = {
"002.jpg": {text:"002", href:"#", click:function( ){return ocevent(2)} },
"003.jpg": {text:"003", href:"#", click:function( ){return ocevent(3)} },
....}
And I use the following code to assign the click property to onclick of
anchor.
a.setAttribute( 'onclick', items[id].click);
However, the code works well in IE but not in Mozilla Firefox. To test the
code go to:
Any suggestion for function pointers?
Comment