By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,796 Members | 1,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,796 IT Pros & Developers. It's quick & easy.

Strange FireFox problem - too much recursion

P: n/a
Hi!

I've implemented some DropDown list in ASP.NET that use Ajax to fetch
the data from the server. The javascript is written to call cascading to
the bottom most dropdown in order to update them all if a top one changed.
The strange thing is that the script runs without problems on IE but in
FireFox i get a "too much recursion" error and nothing happens.

Here is the javascript code generated:

<script language="JavaScript">
<!--
function _ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang() {
var value = document.getElementById( "_ctl12_cob_client" ).value;
var para_0=2;

AjaxMethods.GetChannelsByClientByLang( value, para_0,
_ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang_callback );
}

function
_ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang_callback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getElementById("_ctl12_acob_channel");
var viewStateElem =
document.getElementsByName("_ctl12_acob_channel_VI EWSTATE")[0];
Fill_ListControlFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )
_ctl12_acob_channelAjaxMethods_GetCategoryByChanne lClientLang()
} else {
alert("DataSet corrupted or no data");
}
}
function _ctl12_acob_channelAjaxMethods_GetCategoryByChanne lClientLang() {
var value = document.getElementById( "_ctl12_acob_channel" ).value;
var para_0=document.getElementById("_ctl12_cob_client" ).value;
var para_1=2;

AjaxMethods.GetCategoryByChannelClientLang( value, para_0, para_1,
_ctl12_acob_channelAjaxMethods_GetCategoryByChanne lClientLang_callback );
}

function
_ctl12_acob_channelAjaxMethods_GetCategoryByChanne lClientLang_callback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getElementById("_ctl12_acob_category");
var viewStateElem =
document.getElementsByName("_ctl12_acob_category_V IEWSTATE")[0];
Fill_ListControlFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )

_ctl12_acob_categoryAjaxMethods_GetSubCategoriesBy MainCat_Client_Language()
} else {
alert("DataSet corrupted or no data");
}
}
function
_ctl12_acob_categoryAjaxMethods_GetSubCategoriesBy MainCat_Client_Language()
{
var value = document.getElementById( "_ctl12_acob_category" ).value;
var para_0=document.getElementById("_ctl12_cob_client" ).value;
var para_1=2;

AjaxMethods.GetSubCategoriesByMainCat_Client_Langu age( value, para_0,
para_1,
_ctl12_acob_categoryAjaxMethods_GetSubCategoriesBy MainCat_Client_Language_callback
);
}

function
_ctl12_acob_categoryAjaxMethods_GetSubCategoriesBy MainCat_Client_Language_callback(
response ) {
var ds = response.value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var reciever = document.getElementById("_ctl12_acob_subcategory") ;
var viewStateElem =
document.getElementsByName("_ctl12_acob_subcategor y_VIEWSTATE")[0];
Fill_ListControlFromDataBase( ds, reciever, viewStateElem, 'Name', 'ID' )

} else {
alert("DataSet corrupted or no data");
}
}

function Fill_ListControlFromDataBase( ds, reciever, viewStateElem,
textFieldName, valueFieldName ) {
if(ds != null && typeof(ds) == "object" && ds.Tables != null){
var html = [];
var i=0;
while( reciever.childNodes.length > 0 ) {
var node = reciever.childNodes[0];
reciever.removeChild( node );
}
var vs = [];
for(i=0; i<ds.Tables[0].Rows.length; i++) {
var txt = ds.Tables[0].Rows[i][textFieldName];
var id = ds.Tables[0].Rows[i][valueFieldName]
vs[vs.length] = id + ":" + txt + "|";
var opt = document.createElement("option");
var txt = document.createTextNode( txt );
var atr = document.createAttribute( "value" );
atr.nodeValue = id;
opt.setAttributeNode( atr );
opt.appendChild( txt );
reciever.appendChild( opt );
}

if ( viewStateElem != null ) {
viewStateElem.value = vs.join("");
} else {
alert("No ViewStateFound");
}
}
}

// -->
</script>

Each function on it's own works if i remove the calls for the child
value method.

Has anyone an idea how this can happen as there is no recursion in this
functions.

thanks in advance and greetings,
chris
Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
In article <ne*********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...

Has anyone an idea how this can happen as there is no recursion in this
functions.


There is, but you'd have to understand a stack (and realize that a stack is
what is being used) to realize it.
It's a stack overflow error.

As to why it happens and how to fix it, I'd need a full test example (URL?).
I hate reading through generated code and it's worse when I don't have a DOM
to look at to trace it.

You may want to grab the web developer firefox extension.
--
--
~kaeli~
Is it possible to be totally partial?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2

P: n/a
kaeli wrote:
In article <ne*********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...
Has anyone an idea how this can happen as there is no recursion in this
functions.

There is, but you'd have to understand a stack (and realize that a stack is
what is being used) to realize it.


Well i know this. The thing is that i can'tz find any parts in the
methods that may cause trouble with the stack. There are max. 8 method
calls before the script terminates and in IE it runns without any
warnings or problems.
It's a stack overflow error.

As to why it happens and how to fix it, I'd need a full test example (URL?).
I hate reading through generated code and it's worse when I don't have a DOM
to look at to trace it.
I'll setup a page for you and send you the URL when it' available.

You may want to grab the web developer firefox extension.


I'll try that

thanks & greetings,
chris
Jul 23 '05 #3

P: n/a
In article <ne********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...

Well i know this. The thing is that i can'tz find any parts in the
methods that may cause trouble with the stack.
Okay, I looked at this more thoroughly, and what I don't see is the initial
call to this function (this function seems to set all the rest in motion):

function _ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang() {
var value = document.getElementById( "_ctl12_cob_client" ).value;
var para_0=2;

AjaxMethods.GetChannelsByClientByLang( value, para_0,
_ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang_callback );
}

What calls this?
And since the function it calls takes a parameter called 'response', where is
that coming from?
function
_ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang_callback(
response ) {
var ds = response.value;

I'll setup a page for you and send you the URL when it' available.


Let me know if you get one set up.
I'm curious now. :)

--
--
~kaeli~
A boiled egg in the morning is hard to beat.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4

P: n/a
kaeli wrote:
In article <ne********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...
Well i know this. The thing is that i can'tz find any parts in the
methods that may cause trouble with the stack.

Okay, I looked at this more thoroughly, and what I don't see is the initial
call to this function (this function seems to set all the rest in motion):


right this one calls the next hierachical level and so on. no recusion
in this
function _ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang() {
var value = document.getElementById( "_ctl12_cob_client" ).value;
var para_0=2;

AjaxMethods.GetChannelsByClientByLang( value, para_0,
_ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang_callback );
}

What calls this?
It is called by the OnChange Event handler in an DropDownList
And since the function it calls takes a parameter called 'response', where is
that coming from?
This is the result DataSet that get initialised and transfered to the
client by the Ajax.NET wrapper library.
function
_ctl12_cob_clientAjaxMethods_GetChannelsByClientBy Lang_callback(
response ) {
var ds = response.value;

I'll setup a page for you and send you the URL when it' available.


Let me know if you get one set up.
I'm curious now. :)


Will let you know - maybe i'll manage it to bring it online tonight.

thanks and greetings,
chris
Jul 23 '05 #5

P: n/a
Christian Hubinger wrote:
kaeli wrote:

[snip]

Let me know if you get one set up.
I'm curious now. :)


Will let you know - maybe i'll manage it to bring it online tonight.


Well i've put it online today.

Register yourself at http://www.jobline.cc/jobline.cc
And after logging in insert the URL:
http://www.jobline.cc/jobline.cc/Def...c.aspx?id=4910

Theere you should see 4 drop down lists updating each other without
doing postbacks - works perfectely in IE but FireFox throws the
described errors.
thanks in advance for your help and greetings,
chris

Jul 23 '05 #6

P: n/a
In article <ne********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...

Register yourself at http://www.jobline.cc/jobline.cc


I don't speak German. I don't what to put where in that form.
Register a test account and mail me the username/pass at
tiny_one (at) comcast (dot) net
and I'll check it out when I get home tonight.
Or you can post it here (x-no-archive) and delete the account later.
Whichever floats your boat. :)

You should have a test account set up anyway, even on the production machine,
for things just like this.

For best error tracing, though, you need to pull out as much code as possible
while still recreating the error conditions. Put that in a test page that
doesn't need registering or logging in. It's a LOT easier to trace things
when you pull out all the stuff that does work. Many times I've found my
error just putting together the test case.

--
--
~kaeli~
Condoms should be used on every conceivable occasion.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #7

P: n/a
kaeli wrote:
In article <ne********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...
Register yourself at http://www.jobline.cc/jobline.cc
I don't speak German.


Well i understand we need to add a flag to our language change menu ;)
I don't what to put where in that form.
Register a test account and mail me the username/pass at
tiny_one (at) comcast (dot) net
and I'll check it out when I get home tonight.
Or you can post it here (x-no-archive) and delete the account later.
Whichever floats your boat. :)
Well thanks a lot for you help offer but i've just updated the Ajax.NET
dll we are using to handle XmlHttpRequests and the problem disappeared.
So it was actually a problem with one of the client script this library
thrown on the client.
You should have a test account set up anyway, even on the production machine,
for things just like this.
We are planning to have such a test platform online as soon as we do the
official launch of the plattform. So everything now online is a test
plattform.
For best error tracing, though, you need to pull out as much code as possible
while still recreating the error conditions. Put that in a test page that
doesn't need registering or logging in. It's a LOT easier to trace things
when you pull out all the stuff that does work. Many times I've found my
error just putting together the test case.

Shurely that is what i did on the page i use for testing. The problem is
that we are using our own home brewn portal software and therefore i
neet to test if things work inside that environment. Thats the reason
why i didn't put a simple blank page online.
But you are accutally right i'll setup such a simple playground in the
near future to track down such problems.

So again thanks a lot for your offer.

greetings from vienna,
chris
Jul 23 '05 #8

P: n/a
In article <ne********************@news.sil.at>, e9806056
@student.tuwien.ac.at enlightened us with...

Well thanks a lot for you help offer but i've just updated the Ajax.NET
dll we are using to handle XmlHttpRequests and the problem disappeared.
So it was actually a problem with one of the client script this library
thrown on the client.


I had a feeling it was.
Glad you solved the problem.

--
--
~kaeli~
Murphy's Law #2000: If enough data is collected, anything
may be proven by statistical methods.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #9

P: n/a
Christian Hubinger wrote:
kaeli wrote:
@student.tuwien.ac.at enlightened us with...
Register yourself at http://www.jobline.cc/jobline.cc

I don't speak German.


Well i understand we need to add a flag to our language change menu ;)


No, you don't :) <http://www.cs.tut.fi/~jkorpela/flags.html>
PointedEars
--
Messen, was messbar ist, und messbar machen, was noch nicht messbar ist.
-- Galileo Galilei
Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.