Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Newbie Javascript Question

Posted on 2015-01-07
2
Medium Priority
?
99 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

604 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