Log in

View Full Version : Dropdown menu with external parameters



markcrobinson
06-11-2007, 01:40 AM
I need a simple dropdown that uses an external file for the list of items in the dropdown and links.

Currently, in my site, the list is built into the template and to change the items in the list I need to change the template and re-upload all the pages that use the template.

Using an external file, I can make changes to one file, like menuitems.js, and the dropdowns on pages would change.

ddadmin
06-11-2007, 07:07 AM
It should be possible to convert most menus so the data is pulled from an external .js file instead. For example, in the case of Anylink Menu (http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm), simple take everything within the <script>...</script> tags inside the code of Step 1, paste it into a blank text file, and save as as something.js. Then, reference that on your pages instead:


<script type="text/javascript" src="something.js">

//credit notice goes here

</script>

This tutorial (http://www.javascriptkit.com/javatutors/external.shtml) might be helpful.