Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:36
Changing Menu Items Through JavaScript
Poster: paulie100
Dated: Tuesday January 14 2003 - 19:48:34 GMT
Hi there,
I've just started looking into this menu system, and it is wonderful so far. One question that has come up for me is: Can menu items be changed dynamically, and if so, how? I'm for now thinking very simply, such as just changing the text of the menu item. For example, for a message board, the menu item might say "Boards", but I want to change it to say "Boards-NEW" or put a "New" icon there if a new message is posted while this user is online (this would be detected through php/mysql). So in php, I guess I'd like to code something like:
<?php
if ($newmessages) {?>
<script type=javascript>
****js code to change the menu text here. Is there a class function or variable defined in the menu code that makes this easy? could be simple as an assignment statement***
</script>
<?php
}
?>
It seems like this is likely to be easy, I just don't know the correct data element among all those arrays to reference and change. Also, assuming this is possible, would this update the menu text immediately, or would the menu have to be reloaded?
Thanks!
More clear...
Poster: paulie100
Dated: Tuesday January 14 2003 - 21:11:23 GMT
Woops, I should've been more clear in my message above. I am using the menu in frames. If I weren't, I think what I ask would be easy because I could just create a simple javascript variable with the text I want (prior to the menu scripts being called), and put that variable in the array files instead of straight text.
But, what I want to do is change menu text for a menu in another frame, hopefully without having to refresh that frame.
Thanks again.