Welcome to WebmasterWorld Guest from 54.146.55.156

Forum Moderators: open

Message Too Old, No Replies

External javascript for links drop box

Looking for external JS select box code to avoid page bloat

     
7:47 pm on Jun 20, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 21, 2002
posts:72
votes: 0


We're currently working on a very streamlined update for the main page of our site and have run into an issue involving links...

Basically, we need to add a drop box with a ton of links for returning users. We don't care that they be Google friendly or visable on the page. The problem is that we also want to avoid code bloat. Thus, an on-page standard drop box won't cut it.

Is it possible to do this via external JS? If so, could someone point me to an example of such code?

Many thanks.

2:24 am on June 21, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


One simple way is to use the external file to define the select box's entire code string as a variable, let's call it "box". Then all you need on the HTML page is the call to the external .js file and a script element in the proper spot:

document.write(box)