Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


A simple question ref Array vars into HTML <TD>



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
crazie



Joined: 09 Mar 2008
Posts: 1

PostPosted: Sun Mar 09, 2008 2:18 pm    Post subject: A simple question ref Array vars into HTML <TD> Reply with quote

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
View user's profile Send private message
rangana
250+ Club


Joined: 27 Feb 2008
Posts: 271
Location: Cebu City Philippines

PostPosted: Tue Mar 11, 2008 2:37 am    Post subject: Re: A simple question ref Array vars into HTML <TD> Reply with quote

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 Wink
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap