Wordpress Themes - TV News - Compare UK Credit Cards - Lingerie - Watch Anime

PDA

View Full Version : Need help converting .js file to html


xyphlo
Feb 16th 2009, 1:18 pm
Anyone know how I can covert this .js file to html?

My .js file looks like this:

menu_name=new Array();
menu_link=new Array();
menu_name[1]="Link 1";
menu_link[1]="http://www.site.com";
menu_name[2]="Link 2";
menu_link[2]="]="http://www.site.com";
menu_name[3]="Link 3";
menu_link[3]="]="http://www.site.com";
menu_name[4]="Link 4";
menu_link[4]="]="http://www.site.com";
menu_name[5]="Link 5";
menu_link[5]="]="http://www.site.com";
menu_name[6]="Link 6";
menu_link[6]="]="http://www.site.com";
menu_name[7]="Link 7";
menu_link[7]="]="http://www.site.com";
menu_name[8]="Link 8";
menu_link[8]="]="http://www.site.com";
menu_name[9]="Link 9";
menu_link[9]="]="http://www.site.com";



for (cur=1;cur<menu_name.length;cur++)
{
document.write("<TABLE cellSpacing=0 cellPadding=0 width=170 bgColor=#f8f7f5 border=0>");
document.write("<TBODY>");
document.write("<TR class=button_level1_main_1 id=menu_"+(cur-1)+" onmouseover=\"ov_M_main('menu_"+(cur-1)+"')\" onclick=\"document.location.href='"+menu_link[cur]+"'\" onmouseout=\"ot_M_main('menu_"+(cur-1)+"','button_level1_main_1')\">");
document.write("<TD vAlign=center align=left height=20>");
document.write("<TABLE height=1 cellSpacing=0 cellPadding=0 width=170 bgColor=#ffffff border=0>");
document.write("<TBODY>");
document.write("<TR>");
document.write("<TD vAlign=center align=middle width=20></TD>");
document.write("<TD></TD></TR></TBODY></TABLE>");
document.write('<TABLE height="100%" cellSpacing=0 cellPadding=0 width=170 border=0>');
document.write("<TBODY>");
document.write("<TR>");
document.write('<TD vAlign=center align=middle width=20><IMG height=7 src="images/arrow_black_nofill.gif" width=7></TD>');
document.write('<TD>');
document.write('<TABLE cellSpacing=3 cellPadding=0 width="100%" border=0>');
document.write('<TBODY>');
document.write('<TR>');
document.write('<TD>'+menu_name[cur]+'</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>');
}

Would appreciate any help/

gnp
Feb 16th 2009, 3:51 pm
Your script will produce the following html code (if that is what you are asking ...)

You will need however the referenced images and styles ...

<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_0" onmouseover="ov_M_main('menu_0')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_0','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 1</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_1" onmouseover="ov_M_main('menu_1')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_1','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 2</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_2" onmouseover="ov_M_main('menu_2')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_2','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 3</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_3" onmouseover="ov_M_main('menu_3')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_3','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 4</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_4" onmouseover="ov_M_main('menu_4')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_4','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 5</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_5" onmouseover="ov_M_main('menu_5')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_5','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 6</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_6" onmouseover="ov_M_main('menu_6')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_6','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 7</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_7" onmouseover="ov_M_main('menu_7')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_7','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 8</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
<table bgcolor="#f8f7f5" border="0" cellpadding="0" cellspacing="0" width="170">
<tbody>
<tr class="button_level1_main_1" id="menu_8" onmouseover="ov_M_main('menu_8')" onclick="document.location.href='http://www.site.com'" onmouseout="ot_M_main('menu_8','button_level1_main_1')">
<td align="left" height="20" valign="center"><table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" height="1" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"></td>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="170">
<tbody>
<tr>
<td align="middle" valign="center" width="20"><img src="images/arrow_black_nofill.gif" height="7" width="7"></td>
<td><table border="0" cellpadding="0" cellspacing="3" width="100%">
<tbody>
<tr>
<td>Link 9</td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>

mortgageloan
Feb 17th 2009, 5:00 am
ya..but is this what you wanted to know??

xyphlo
Feb 17th 2009, 8:08 am
Yes, I think this is what I need. I will try it out.

xyphlo
Feb 18th 2009, 1:26 pm
I need to get rid of the menu ids and document.writes so that it's just plain html. Is that possible. I tried to plug this in and you still can't see the links at the bottom of the browser so I know the SEs can't see them either.