I have this javascript control that I made for Olap cubes. I tried to make
it as compact and selfcontained as possible, meaning that I created a
javascript object, with methods and everything). It works. Then I added the
Ajax component and now I get weird javascript errors.
This is a part of the code:
cell.onclick=new Function('Expand(this,\''+dimension+'\');');
where dimension is a string like 'string';
After adding the Ajax reference I get a javascript error 'unterminated
string literal' and the code that FireFox shows is Expand(this,'string,
function(items) {...
It's hard enough to explain, and I have no idea about where the problem is
and how to fix it. Is this a memory leak or something? Please help!
BTW, the errors are in any browser, not just FireFox. FF just happends to
display a more comprehensive error.
This is a larger part of the code:
OlapTable.prototype.AddHeaderDimension=function(dimension) {
var sp=dimension.split(this.separatorChar);
var row=this.table.rows[sp.length-1];
var cell=row.insertCell(row.cells.length);
var n=0;
for (var c=0; c<this.columns.length; c++)
if (StartsWith(this.columns[c],dimension)) n++;
FillCell(cell,dimension,null);
cell.colSpan=n;
cell.innerHTML=sp[sp.length-1];
if (n==1) {
cell.onclick=new
Function('Expand(this,\''+dimension+'\');');
var children=this.ServerGetChildren(dimension);
if (children&&(children.length>0))
addClass(cell,'collapsed');
} else {
cell.onclick=new
Function('Collapse(this,\''+dimension+'\');');
addClass(cell,'expanded');
}
var i=sp.length;
while (i<this.table.headerRows) {
var row=this.table.tHead.rows[i];
var cell=row.insertCell(row.cells.length);
FillCell(cell,dimension,null);
i++;
}
for (var c=0; c<this.columns.length; c++)
if
(StartsWith(this.columns[c],dimension)&&(this.columns[c].split(this.separatorChar).length==sp.length+1))
{
this.AddHeaderDimension(this.columns[c]);
}
}
____________
Costin Manda
ECRM Europe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---