Solved

Newbie Javascript Question

Posted on 2015-01-07
2
84 Views
Last Modified: 2015-01-07
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>
<html>
<head>
    <meta charset="utf-8">
    <title>Test Page</title>
</head>
    <body>
        <div id="ecoFooter"><script src="ecobarRoot/ecoBar.js"></script></div>
    </body>
</html>

Open in new window


Then, the ecoBar.js file has this:  
initialize();

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...");
	}
	
	alert("Test2");
	
	return;
	
}

Open in new window


I get the first alert, and then none of the alerts that follow.  Any ideas?
0
Comment
Question by:Javin007
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 40535924
getElementById("ecoFooter");

Case sensitive on "Id", not "ID"
0
 
LVL 4

Author Closing Comment

by:Javin007
ID: 40535926
Oh wow. :P  Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now