ugly source code with embedded javascript in html

N

ngoc

Hi
I want to make homepage with javascript for drop down navigation menu.
Looking around some webpages, I see javascript code is embedded in html
code. It is ugly and unmaintainable. Are there any way to make a
navigation menu in a file and link to it like CSS technique? So when I
change something in navigation menu file, any pages is changed.
Thanks
ngoc
 
M

Martin Honnen

ngoc wrote:

I want to make homepage with javascript for drop down navigation menu.
Looking around some webpages, I see javascript code is embedded in html
code. It is ugly and unmaintainable. Are there any way to make a
navigation menu in a file and link to it like CSS technique?

You can certainly put script code into an external JavaScript file and
include it with
<script type="text/javascript" src="file.js"></script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top