Display and Reset

Now that we know which button was clicked and which headline number should be displayed, we need to display what is called and then reset all the values.

provided by: 
Originally published at Internet.com


How you doin'?

Now we know which button was clicked and which headline number should be displayed. Now we need to display what is called for and then reset all the values so that we're ready for the next time the user clicks.

The Script's Effects

----------------------------------- Here's the Code

It time for headMach() part two. We know the number of the headline currently in the text display. We've either increased that number by one or taken it down by one depending on which button the user clicked. Now, let's get the display and reset the values:

if (headShow == 1) { var _head = "first headline"; var inlocat = "firstlocation.html"; } if (headShow == 2) { var _head = "second"; var inlocat = "secondlocation.html"; } if (headShow == 3) { var _head = "third"; var inlocat = "thirdlocation.html"; } if (headShow == 4) { var _head = "and so 4orth"; var inlocat = "fourthlocation.html"; } document.headline.headHere.value = _head; document.headline.nowShowing.value = headShow; document.headline.shownext.value = "N"; document.headline.showprev.value = "N"; document.headline.inlocation = inlocat; We already know there are four headlines. We set that at the top of the function. So we need to now offer the actual text and links associated with each headline number...

Read article at Internet.com site
Regional Articles

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML