Talking to myself is soo cool :)
Anyway, I found the problem up. I was using in the code something like
for (var c in arr) ...
and it returned not only the elements of the array but also the additional
methods.
____________
Costin Manda
ECRM Europe
----- Original Message -----
From: "Costin Manda" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 08, 2006 12:43 PM
Subject: [ajaxpro] Re: Memory leak?
>
> I managed to narrow down the error. It seems that I am using an array as a
> subobject
> this.columns=new Array();
>
> then ajax comes and adds stuff:
>
> Object.extend(Array.prototype, {
> push: function(o) {
> this[this.length] = o;
> },
> addRange: function(items) {
> if(items.length > 0)
> for(var i=0; i<items.length; i++)
> this.push(items[i]);
> },
> clear: function() {
> this.length = 0;
> return this;
> },
> shift: function() {
> if(this.length == 0) return null;
> var o = this[0];
> for(var i=0; i<this.length-1; i++)
> this[i] = this[i + 1];
> this.length--;
> return o;
> }
> }, false);
>
>
> and now this.columns.length is not the same as before and if I do a for
> loop
> through the array I also get the functions added:
>
> for (int c=0; c<arr.length; c++) alert(arr[c]);
>
> That can't be right, can it? I am trying to replicate the problem in a
> more
> simple manner, but I couldn't do it yet.
>
> ____________
> Costin Manda
> ECRM Europe
>
> ----- Original Message -----
> From: "Costin Manda" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Tuesday, August 08, 2006 12:02 PM
> Subject: Memory leak?
>
>
>>
>> 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/
-~----------~----~----~----~------~----~------~--~---