AllExperts > DHTML 
Search      
DHTML
Volunteer
Answers to thousands of questions
 Home · More DHTML Questions · Answer Library  · Encyclopedia ·
More DHTML Answers
Question Library

Ask a question about DHTML
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Andrew Hoffman
Expertise
I can field just about any question within this topic ranging from JavaScript to CSS, the two ingredients of DHTML. I`m very interested in the W3C and its validation rules for HTML, XHTML, and CSS, and enjoy answering questions of this type as well. I detest sleep and respond at all hours of the day or night.


Experience
Experience in the area
I've been working with DHTML and CSS for 7 years now and build/maintain websites of my own that implement DHTML navigation.

What I'm doing now
My contract with Microsoft has ended and I am working for myself once again. Please contact me for any front-end work at antibland@gmail.com

 
   

You are here:  Experts > Computing/Technology > HTML/XML > DHTML > Javascript Question...

DHTML - Javascript Question...


Expert: Andrew Hoffman - 3/30/2009

Question
Got from www.dymanimdrive.com. My web address is http:/hwc.ccc.edu/creativeaging. Address of my Javascript file is http://hwc.ccc.edu/creativeaging/menuItems2.js. Got the script from here http://www.dynamicdrive.com/dynamicindex1/popit.htm. Tried to add "Spring 2009 Lecture Series" as a link, but not taking for some unexplained reason.

Answer
Hi Dennis,

You're missing a '+' sign.  Here's what you have:

linkset[1]='<a href="lectureseries.htm">Spring 2009 Lecture Series</a>'
linkset[1]+='<hr>' //Optional Separator
linkset[1]='<a href="main.htm">Spring 2008 Lecture Series</a>'
linkset[1]+='<hr>' //Optional Separator
linkset[1]+='<a href="lecture.htm">Spring 2007 Lecture Series</a>'

Here's what you need:

linkset[1]='<a href="lectureseries.htm">Spring 2009 Lecture Series</a>'
linkset[1]+='<hr>' //Optional Separator
linkset[1]+='<a href="main.htm">Spring 2008 Lecture Series</a>'
linkset[1]+='<hr>' //Optional Separator
linkset[1]+='<a href="lecture.htm">Spring 2007 Lecture Series</a>'

In the first block, you're seeing the first item to Spring 2009 Lecture Series--which is what you wanted.  But then, on the third line, you're resetting teh linkset[1] array by using '=' without the '+'.  The plus sign says, 'take what we have so far and add this to it.'  The equals sign says, 'I don't care what we may have had.  Now all we have is this.'  

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.