PDA

View Full Version : Help with Creating JavaScipts for page layouts.



francinehds
03-19-2009, 06:42 AM
It's 2:10 am here, so I'm apologizing in advance if this post doesn't make perfect (or any) sense.

My website that I'm working on right now has about 25 pages. Each pages layout is exactly the same. There is a section at the top, with the organization name, slogan and some rotating pictures (that I got a js script for, here on this site. Works great, btw!!).

Down the left side of each page is a column with the menu (which pops out to submenus, another js script I got here), and under the menu is 3 "news" articles, that are each in a js script as well, so they can easily editted.

The right side of the screen (the majority of the page), under the "header" is the main body of the page, where the differences in the pages shows up.

Is there a way to get all the information from each page onto a js file, so that if I need to edit the main format of the page, I don't have to do every single page? I wouldn't mind doing it once (for creating this javascript) but for minor changes, it's very tedious work.

The code is very long, and I"m not sure how much of it you would need. I understand that I can't take out anything above "body".

Here's the lengthy code that I'm referring to:



<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="780" border="0" align="center" cellpadding="7" cellspacing="0" bgcolor="#FFFFFF">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="left" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="29%" align="left" valign="top" bgcolor="#1A3A77">
<table width="97%" border="0" cellspacing="0" cellpadding="0">

<tr><td align="center" valign="bottom" class="style8">Organization</td>
</tr></table></td>
<td width="32%" align="center" valign="middle" bgcolor="#E9E3E7" class="style5">Slogan</td>
<td width="36%" align="right" valign="top"><script src="css/pictures.js" type="text/javascript">

/***********************************************
* Translucent Slideshow script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/</script>

</td></tr>

<tr><td colspan="3" align="left" valign="top" bgcolor="#939EBC"><img src="images/spacer.gif" alt="" width="1" height="4"></td></tr></table></td></tr>
<tr><td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><img src="images/box_top.jpg" width="769" height="2" alt=""></td></tr>
<tr><td background="images/box_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="230" align="center" valign="top"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center" valign="top"><table width="95%" border="0" cellspacing="4" cellpadding="0">
<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="28" align="center" class="style4">&raquo;</td>
<td><span class="style1"><a href="index.html">Home</a></span></td></tr>

<tr><td colspan="2" align="center" background="images/dots2.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
</table></td></tr>
</table></td></tr>
<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="28" align="center" class="style4">&raquo;</td>
<td><span class="style1"><a onMouseover="dropdownmenu(this, event, menu1, '165px')" onMouseout="delayhidemenu()">About Us</a></span></td></tr>
<tr><td colspan="2" align="center" background="images/dots2.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>

</table></td>
</tr></table></td></tr>
<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td width="28" align="center" class="style4">&raquo;</td>
<td><span class="style1">
<a onMouseover="dropdownmenu(this, event, menu2, '165px')" onMouseout="delayhidemenu()">Defects, Stats, Links</a></span></td></tr>
<tr><td colspan="2" align="center" background="images/dots2.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
</table></td></tr>
</table></td></tr>
</table></td></tr>
<tr> <td align="center" valign="top"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="10"></td></tr>
<tr><td align="center" valign="middle" background="images/dots.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="8"></td></tr>
<tr><td align="left" valign="middle"><span class="style2">&nbsp;Upcoming Events</span></td></tr>
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="10"></td></tr>
<tr><td align="center" valign="middle" background="images/dots.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="8"></td></tr>
</table></td></tr>
<tr> <td><script src="css/news1.js" type="text/javascript">
</script></td></tr>
<tr><td>&nbsp;</td></tr>
<tr> <td background="images/dots.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
<tr> <td>&nbsp;</td></tr>
<tr><td><script src="css/news2.js" type="text/javascript">
</script></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td background="images/dots.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td> </tr>
<tr><td>&nbsp;</td>

<tr><td><script src="css/news3.js" type="text/javascript"></script></td> </tr>
<tr><td>&nbsp;</td></tr>
</table></td></tr>
<tr><td align="center" valign="top"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="10"></td></tr>
<tr><td align="center" valign="middle" background="images/dots.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="8"></td></tr>
<tr><td align="left" valign="middle"><span class="style2">&nbsp;Next Meeting</span></td></tr>
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="10"></td></tr>
<tr><td align="center" valign="middle" background="images/dots.gif"><img src="images/spacer.gif" alt="" width="1" height="1"></td></tr>
<tr><td align="center" valign="middle"><img src="images/spacer.gif" alt="" width="1" height="8"></td></tr>
</table></td></tr>
<tr><td><script src="css/meeting.js" type="text/javascript"></script></td>
</tr>
<tr><td>&nbsp;</td></tr>
</table></td></tr>
</table></td>


Thanks for any help you can provide.

Francine

francinehds
03-22-2009, 06:33 AM
Anybody? :confused: