Hi all,
I am trying to store object(user defined) into array and then display it when required.
eg:
function E(fieldname,msg)
{
// initialize the member variables for this instance
this.x= fieldname;
this.y= msg;
// initialize the member function references
this.getFieldname = getFieldname;
this.setFieldname = setFieldname;
this.getmsg = getmsg;
this.setmsg = setmsg;
}
function getFieldname()
{
return this.fieldname;
}
function setFieldname(fieldname)
{
this.fieldname = fieldname;
}
function getmsg()
{
return this.msg;
}
function setmsg(msg)
{
this.msg = msg;
}
//end
Then storing these in array
later on iterate the array and get to the object variables.But it does not understand the object.
In java the objects could be typecasted don't know in javaScript?
something like this
var c=(E)object;
Is it posssible?
Does any one know?
Thanks in advance.
I am trying to store object(user defined) into array and then display it when required.
eg:
function E(fieldname,msg)
{
// initialize the member variables for this instance
this.x= fieldname;
this.y= msg;
// initialize the member function references
this.getFieldname = getFieldname;
this.setFieldname = setFieldname;
this.getmsg = getmsg;
this.setmsg = setmsg;
}
function getFieldname()
{
return this.fieldname;
}
function setFieldname(fieldname)
{
this.fieldname = fieldname;
}
function getmsg()
{
return this.msg;
}
function setmsg(msg)
{
this.msg = msg;
}
//end
Then storing these in array
later on iterate the array and get to the object variables.But it does not understand the object.
In java the objects could be typecasted don't know in javaScript?
something like this
var c=(E)object;
Is it posssible?
Does any one know?
Thanks in advance.