• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 102
  • Last Modified:

Newbie Javascript Question

So I'm sure this is absurd, but I'm a newbie to Javascript development (very familiar with normal application development though, and familiar with .NET/Java as background.)  

I've got a simple html page as follows:
<!doctype html>
    <meta charset="utf-8">
    <title>Test Page</title>
        <div id="ecoFooter"><script src="ecobarRoot/ecoBar.js"></script></div>

Open in new window

Then, the ecoBar.js file has this:  

function initialize() {
	alert("This alert works...");
	var divFooter = document.getElementByID("ecoFooter");
	if (divFooter == null) {
		alert("Warning!  divFooter not found!");
	} else {
		alert("So far so good...");

Open in new window

I get the first alert, and then none of the alerts that follow.  Any ideas?
1 Solution
Tom BeckCommented:

Case sensitive on "Id", not "ID"
Javin007Author Commented:
Oh wow. :P  Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now