|
| |
|
|
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?!
|
|
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
|
|
|