Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undefined Error Message 1

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
I have the below function which is called from another function. I keep getting the message that 'xOffset is undefined', yet its clearly being passed in when I alert it out.

The call is from another function and looks like this:
Code:
  RemoveTab('tractor','0');

Code:
function RemoveTab(sDiv, x0ffset)
{
   var thisTabDiv   = 'tabtab'+ sDiv + xOffset;
   var thisDataDiv  = 'data' + sDiv + xOffset;
   var thisShowTab  = 'tabtab'+ sDiv + parseInt(xOffset + 1);
   var thisShowData = 'data' + sDiv + parseInt(xOffset+1);

   alert(thisTabDiv +'\n'+ thisDataDiv+'\n'+thisShowTab +'\n'+ thisShowData);
   document.getElementById(thisTabDiv).innerHTML = '';
   document.getElementById(thisDataDiv).innerHTML = '';
   document.getElementById(thisShowTab).style.display = 'inline';
   document.getElementById(thisShowData).className = "SelectedTab";

   showMessage = "<span style='color:red;'><strong>Record Deleted</strong></span>";
}

I seem to be missing a clue this morning, so if someone could supply me with one, I'd appreciate it.

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Hi
[ul]
[li]Are you sure the error occurs in the RemoveTab() function ?[/li]
[li]Are you sure the called RemoveTab() function is the same you posted ?[/li]
[/ul]
Even if xOffset is [tt]undefined[/tt], nobody cares about that in the code you posted.


Feherke.
 
Yes, on line 71, which is the first line in the function. and yes its the same function

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
yes, no other vars named xoffset

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Looks like your function is expecting a variable called x'zero'ffset and then you try to use a variable named x'O'ffset.

In other words x[red]0[/red]ffset is different than X[red]O[/red]ffset.

Probably just a typo.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
vacunita - good eye! I had to put the code in MS Word where I could see the text in Arial and the difference quickly became apparent.

Not my post, but I'm giving you a star for quickly picking up what's likely the root cause.
 
Damn keyboard...damn fat fingers

thanks guys.

Bastien

I wish my computer would do what I want it to do,
instead of what I tell it to do...
 
Thanks for the star. I noticed it when I was about to copy he code, the "O" in the function declaration variable looked narrower than the one inside the function. I realized it was a Zero and not a Oh.






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top