| View previous topic :: View next topic |
| Author |
Message |
crazie
Joined: 09 Mar 2008 Posts: 1
|
Posted: Sun Mar 09, 2008 2:18 pm Post subject: A simple question ref Array vars into HTML <TD> |
|
|
How can I get the program to put the returned value into a table on the same page as the original link. So far, all I have manged to achieve is to use the document.write method but this puts the value onto a fresh page and I want it in the page it was requested.
The code is as follows:
<body>
<table width="300">
<tr>
<td>
<a href="#" onmouseover="subMenu(0);">Link A</a>
</td>
<td>
<script type="text/javascript">
function subMenu(funcNum){
newFuncNum=new Array("<a href=#>Link A</a>");
return(newFuncNum[funcNum]);
}
</script>
</td>
</tr>
</table>
Just in case you are wondering why I only have one value in my array it is due to wanting to get the function to return the value before I expand the program.
As you can tell I'm kinda new to this so any help would be appreciated
Peth |
|
| Back to top |
|
 |
|
|
rangana 250+ Club

Joined: 27 Feb 2008 Posts: 271 Location: Cebu City Philippines
|
Posted: Tue Mar 11, 2008 2:37 am Post subject: Re: A simple question ref Array vars into HTML <TD> |
|
|
Yes, document.write is not a good practice since it produces 'unpredictable' outputs and overrides your page's contents.
You should be using <div> instead of tables..and when div, the easiest way is to have it display during onClick.
Hope made some sense  |
|
| Back to top |
|
 |
|