Solved

Newbie Javascript Question

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
html form layout 4 36
How to get text of href without any ID using Javascript 9 24
Html using "Or" in condition 3 27
JS to redirect to prev page 8 24
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.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

726 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