JavaScript bug
-
var splitter;
function CreateSplitter()
{
spliter = document.createElement("div");
spliter.innerHTML = "Some Text";document.body.appendChild(spliter);
}function XYZ()
{
//Later in the code
splitter.innerHTML = "Some thing else";
}Sometimes when I am fortunate I get "object does not support this property or method" at other times it is very difficult to figure out what is going on. Whether you use global variables or closures the problem occurs.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
-
var splitter;
function CreateSplitter()
{
spliter = document.createElement("div");
spliter.innerHTML = "Some Text";document.body.appendChild(spliter);
}function XYZ()
{
//Later in the code
splitter.innerHTML = "Some thing else";
}Sometimes when I am fortunate I get "object does not support this property or method" at other times it is very difficult to figure out what is going on. Whether you use global variables or closures the problem occurs.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
Took me a while. Don't you sometimes wish Javascript had an Option Explicit? ;)
cheers, Chris Maunder
CodeProject.com : C++ MVP
-
Took me a while. Don't you sometimes wish Javascript had an Option Explicit? ;)
cheers, Chris Maunder
CodeProject.com : C++ MVP
Yes.
I am tired and sleepy that's why i am at office. -- Adnan Siddiqi, The Soapbox's Future
-
var splitter;
function CreateSplitter()
{
spliter = document.createElement("div");
spliter.innerHTML = "Some Text";document.body.appendChild(spliter);
}function XYZ()
{
//Later in the code
splitter.innerHTML = "Some thing else";
}Sometimes when I am fortunate I get "object does not support this property or method" at other times it is very difficult to figure out what is going on. Whether you use global variables or closures the problem occurs.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
Oh wow. I've spent close to an hour looking for a similar bug. Was to the point of re-writing a whole event-handling system when i finally saw it. :doh:
I am tired and sleepy that's why i am at office. -- Adnan Siddiqi, The Soapbox's Future
-
Took me a while. Don't you sometimes wish Javascript had an Option Explicit? ;)
cheers, Chris Maunder
CodeProject.com : C++ MVP