我有一个表,它有一个名为“recordsource”的属性,它将保存填充表内容的对象的名称。
<table id="tbl" recordsource="myobj">
现在这是我的功能:
var myobj;
function obj()
{
this.code = new Array();
this.name = new Array();
}
myobj = new obj();
myobj.code = ["a","b","c"];
myobj.name = ["apple","banana","carrot"];
function populate_table()
{
mytable = document.getElementById("tbl");
mytableobj = mytable.getAttribute("recordsource"); //this will return a string
//my problem is how to reference the recordsource to the myobj object that have
//the a,b,c array
}