Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] Comparing Strings - Correction


  • From: wdlists at triche-osborne.com (Triche Osborne)
  • Subject: [Javascript] Comparing Strings - Correction
  • Date: Thu Aug 25 09:20:12 2005

Oops! I had this in a testing function and forgot to replace the passed 
variable with its literal.

This line:
> var theNode = document.getElementById(nodeId);

Should read:
var theNode = document.getElementById("replaceThis");

The corrected version would look like this:

<div id="replaceThis">Text to be replaced.</div>

var replacementText = "Hi there!";
var theNode = document.getElementById("replaceThis");
theNode.firstChild.data = replacementText;

Sorry for the confusion!

Triche