- Impact
- 0
I'm not using php or any active scripting nor am I using any programs, just Notepad.
I'm using normal HTML with CSS and JS
I was wondering if there was an easy way to dump my navigation bar on a seperate document that can be inserted into the html file. This would make changing my navigation bar (if ever) very easy.
One way I know of is by using JS, document.write("navigation bar code")
This however, becomes very tedious and messy.
For example
I was hoping that there was a way of dumping HTML code on a seperate file while keeping it visually editable
meaning... keeping it in a seperate file similiar to this
True, I could use a for loop, but it still gets messy because I actually have alot more code involved then just what I've shown (wanted to keep it somewhat simple while explaining my problem).
Any ideas?
I'm using normal HTML with CSS and JS
I was wondering if there was an easy way to dump my navigation bar on a seperate document that can be inserted into the html file. This would make changing my navigation bar (if ever) very easy.
One way I know of is by using JS, document.write("navigation bar code")
This however, becomes very tedious and messy.
For example
Code:
function dumpmenu(){document.write("<table class=menu><tr><td>menu1</td><td>menu2</td><td>menu3</td><td>menu4</td><td>menu5</td><td>menu6</td><td>menu7</td></tr></table>");}
--------
<html>
<head><script language="javascript" src="menu.js"></script></head>
<body>
<script>dumpmenu();</script>
</body>
</html>
I was hoping that there was a way of dumping HTML code on a seperate file while keeping it visually editable
meaning... keeping it in a seperate file similiar to this
Code:
<table class=menu>
<tr>
<td>menu1</td>
<td>menu2</td>
<td>menu3</td>
<td>menu4</td>
<td>menu5</td>
<td>menu6</td>
<td>menu7</td>
</tr></table>
True, I could use a for loop, but it still gets messy because I actually have alot more code involved then just what I've shown (wanted to keep it somewhat simple while explaining my problem).
Any ideas?












