Solved

Newbie Javascript Question

Posted on 2015-01-07
2
96 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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 the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 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