November 14th, 2007
We have all seen those handy little show/hide buttons that hide content until a user wants to see it. Here is a walkthrough on how to create those visible/not visible divs.
Example:
function showCode(codeblockID, buttonID){
if (document.getElementById(codeblockID).style.display==’none’){
document.getElementById(codeblockID).style.display=”;
document.getElementById(buttonID).value=’Hide Code’;
}
else{
document.getElementById(codeblockID).style.display=’none’;
document.getElementById(buttonID).value=’Show Code’;
}
}
The html code for the Show/Hide Code button is:
<input type=”button” value=”Show Code” onclick=”showCode(’showBox’,’showButton’)” class=”submit” id=”showButton”/>
So let’s break this […]
Filed under: JavaScript | No Comments
October 27th, 2007
Did you know that you can easily debug JavaScript errors with Firefox?
First, start off by installing the web developer toolbar for Firefox.. You do not really have to download this in order to see the errors - but it is a great utility for developing web applications.
So, lets say you are creating a JavaScript validation […]
Filed under: JavaScript | 3 Comments
September 27th, 2007
JavaScript: A scripting language for web sites that was developed by Netscape. JavaScript is run on the client side as opposed to the server side. (In server side programming such as ASP and PHP, the broswer has to go back to the server and the code is processed there. In client side programming, all […]
Filed under: JavaScript | No Comments
November 5th, 2006
Here is a step-by-step tutorial on making a guessing game in JavaScript - like this page:
JavaScript Guessing Game
Create a form. The form should have an input field and a button. When the user clicks the button, an event handler should be used (maybe onclick?) to find out what number the user entered in the form. […]
Filed under: JavaScript | No Comments