navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Using a JavaScript function to perform HTML code

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Using a JavaScript function to perform HTML code
Page: [1]
 
avilla

 

Posts: 37
From: Oranjestad, Aruba
Status: offline

 
Using a JavaScript function to perform HTML code - 3/15/2002 14:09:36   
Hi,

I have the following HTML code in a table cell:

<a href="index.htm"><img src="Image01.gif" ></a>

So, this is a cell containing a simple image which can hyperlink to index.htm.

What I want to know is, if the following is possible:

Can the follwing be placed in the table cell:

<Script>MyFunc()<Script>

and this would be a function which resides in an external js file.

this function does the same as the HTML code above.

To clarify
----------

Why would I want to do this?
Well I have a couple of pages which will contain the same image, and these image would be a link to the index page.
I want a way that in the future if I change the appearance of the image or the page to link to, I don't have to change HTML code in every page.
This way everything is in a js file, and I could just change the Js file.

Thanks for any help,


Armando A. Villasmil Jr.
puiwaihin

 

Posts: 1378
From: Taiwan
Status: offline

 
RE: Using a JavaScript function to perform HTML code - 3/15/2002 14:30:50   
Yes, this can be done. I think all you need to do is link to the script there:
<script language="javascript" src="yourfile.js">
</script>

And in the .js file use document.write() to place your image and its parameters.

But have you considered using a FP Include, SSI, or a server-side script like php or asp? I think that would be a more elegant solution.

----------
Who put the self-destruct button THERE?!

(in reply to avilla)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Using a JavaScript function to perform HTML code
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts