Converting html to javascript

M

meeni

Guest
Hi,

Trying to find a tool that converts html code to javascript code that I am going to use in an include. There is a lot of tools out there but it seems like they all just work for PC's is there anyone that know one that works on Mac?

Thanks

M
 
Joined
Apr 2, 2006
Messages
51
Reaction score
0
Points
6
HTML and javascript are completely different types of languages, and cant be converted. What do you mean included? You just put the javascript you want to use in the html document with a script tag.
 
Joined
Jan 18, 2006
Messages
1,868
Reaction score
106
Points
63
Your Mac's Specs
G4 Cube
meeni said:
Hi,

Trying to find a tool that converts html code to javascript code that I am going to use in an include. There is a lot of tools out there but it seems like they all just work for PC's is there anyone that know one that works on Mac?

Thanks

M

I think what you may be looking for is a PHP solution. I use PHP on a couple of my websites for handling templates. My Wired by Nature website uses a table-based layout. I created a template based on that table format, then broke it down into sections to wrap around the content. Each section chunk was put into an individual PHP file in a common directory on my server. This way, whenever I want to make a site-wide change, I only have to change my template files. For example, my header consists of a graphical logo and a list of links. I put the code in a file called header.php in a common directory and reference that file in each webpage like this:

<?php include $_SERVER['DOCUMENT_ROOT'] . '/detox/header.php'; ?>

The header.php file consists of this code:

<tr>
<td align="center">

<img src="http://www.wiredbynature.org/detox/header.jpg">
<font size="2" face="Arial">
<a href="http://www.wiredbynature.org/">Home</a>  | 
<a href="http://www.wiredbynature.org/about.html">About</a>  | 
<a href="http://www.wiredbynature.org/art/">Art</a>  | 
<a href="http://www.wiredbynature.org/cars/">Cars</a>  | 
<a href="http://www.wiredbynature.org/comp/">Computers</a>  | 
<a href="http://www.wiredbynature.org/food/">Food</a>  | 
<a href="http://www.wiredbynature.org/ht/">Home Theater</a>  | 
<a href="http://www.wiredbynature.org/cpanel">Login</a>  
</font>
<br />
<br />
</td>
</tr>


Rather than having to deal with all of that code, and the rest of the template code, in every page I make, I have just six lines to code to handle the template. I can easily toss up an article or other webpage using this template. Is this the kind of thing you're looking for?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top