Original Post
Greetings, my first post here in years. Man this site has changed but anyway, Im getting into Web Development. I took a basic HTML and JavaScript class back in 2007 but never really did much with it otherwise.
Im back in School so I picked up Dreamweaver which is what Ill be doing my development in. So I poking around with the DOM and JavaScript to get some kind of navigation for a rudimentary site I put together.
Both using the DOM to alter the InnerHTML of divs or toggling the display style of divs worked fine in Dreamweaver but not on any of my browsers. Well actually the toggling method worked in IE but I get the window asking me to open the file which irritates me. Is there any way to turn that off in IE and what do you think is wrong with some of my Scripts that they'd not work in most of the browsers? [font="Arial"] Is there something about how the web Browsers handle scripts local to your machine?[/font]
[font="Arial"]
[/font]
[font="Arial"]for what its worth heres some code...[/font]
[font="Arial"]
[/font]
[font="Arial"]
[/font]
[font="Arial"]the toggle way...[/font]
[font="Arial"]
[/font]
[font="Arial"]
[font="Arial"]
[/font]
[font="Arial"]the assignment way...[/font]
[font="Arial"]
[/font]
[font="Arial"][html][/font]
[font="Arial"]function DoNavigationNews()
{
var newContent = document.getElementById("News").innerHTML;
var InnerContent = document.getElementById("InnerContent");
InnerContent.innerHTML = newContent;
}[/font]
[font="Arial"][/html]
[/font]
[font="Arial"]
[/font]
Im back in School so I picked up Dreamweaver which is what Ill be doing my development in. So I poking around with the DOM and JavaScript to get some kind of navigation for a rudimentary site I put together.
Both using the DOM to alter the InnerHTML of divs or toggling the display style of divs worked fine in Dreamweaver but not on any of my browsers. Well actually the toggling method worked in IE but I get the window asking me to open the file which irritates me. Is there any way to turn that off in IE and what do you think is wrong with some of my Scripts that they'd not work in most of the browsers? [font="Arial"] Is there something about how the web Browsers handle scripts local to your machine?[/font]
[font="Arial"]
[/font]
[font="Arial"]for what its worth heres some code...[/font]
[font="Arial"]
[/font]
[font="Arial"]
[/font]
[font="Arial"]the toggle way...[/font]
[font="Arial"]
[/font]
[font="Arial"]
[/font]
[font="Arial"]function DoNavigationWelcome()
{
document.getElementById("WelcomeContent").style.display = "block";
if(CurrentContentId != "WelcomeContent")
document.getElementById(CurrentContentId).style.display = "none";
CurrentContentId = "WelcomeContent";
}[/font]
[font="Arial"][/font][font="Arial"]
[/font]
[font="Arial"]the assignment way...[/font]
[font="Arial"]
[/font]
[font="Arial"][html][/font]
[font="Arial"]function DoNavigationNews()
{
var newContent = document.getElementById("News").innerHTML;
var InnerContent = document.getElementById("InnerContent");
InnerContent.innerHTML = newContent;
}[/font]
[font="Arial"][/html]
[/font]
[font="Arial"]
[/font]