|
|
|
May I can use PHP code in menu items of my html menu javascript?
Return to Recent Questions
Q:
May I can use PHP code in menu items of my html menu javascript?
A:
You may generate a menu from a database or XML using any server-side script, e.g., PHP, ASP, VB, etc.
However, these scripts don't work inside of Javascript .js files, so, you should move parameters of a menu from a .js file into an html-page, e.g.:
<!-- Deluxe Menu -->
<noscript><a href="http://deluxe-menu.com">html menu javascript by Deluxe-Menu.com</a></noscript>
<script type="text/javascript">var dmWorkPath = "menudir/";</script>
<script type="text/javascript" src="menudir/dmenu.js"></script>
<!-- (c) 2006, http://deluxe-menu.com -->
<script type="text/javascript" language="JavaScript1.2">
// and describe parameters of a menu
var parameter1=value1;
var parameter2=value2;
etc.
var menuItems = [
// here you generate items using server-side scripts (php, asp, vb, etc.)
];
</script>
The example of the menu working with PHP/MYSQL you can find here:
http://deluxe-menu.com/rq-loading-bar-MySQL-support.html
Return to Recent Questions
Related:
- March 15, 2009 - How can I disable items in menu site web?
- March 21, 2009 - I am trying to get my submenu to be all black in my select javascript...
- March 30, 2009 - Is there a way to optimize the mouse position javascript to reduce the loading time for submenus?
- March 31, 2009 - Is there any way can we display submenu items on mouse over in drop down menu css?
- Apr 01, 2009 - How can I set different parameters for diferent items in my javascript expanding menu?
- Apr 03, 2009 - I would like to change the height of the submenu items in the javascript cascading menu...
- Apr 04, 2009 - Is there a way to have an automatic line-break for large submenu items in menu using java script?
- Apr 06, 2009 - I am trying to use the menu javascript download in a perl script.
- Apr 06, 2009 - Can the link items NOT open a new window in the tree menu html?
- Apr 11, 2009 - I cannot see the shadow on the top items in my menu cascading example.
- Apr 15, 2009 - My mainmenu items are not links. So I need no link cursor for these dynamic dependant dropdown menus items.
|