Re: Dynamically changing links in a web page menu when a link is clicked [message #182194 is a reply to message #182189] |
Wed, 17 July 2013 20:34 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 7/17/2013 2:37 PM, Jason Bodine wrote:
> Hi all,
> Please excuse me if this question has been asked before, but I am new to php and can't seem to find the answer to my question anywhere.
>
> I am designing a website for my company. The site will have a JQuery accordion menubar across the top and a sidebar menu as well. What I would like to do, using php in order to save myself the trouble of cluttering my html with menu code on every single page on the site, is make it so that when someone clicks on a link in the menubar, the links listed in the sidebar change according to what was clicked. For example, if someone were to click on "About" in the menubar, the sidebar would display different "About"-related hyperlinks ("About Us", "Management", "Our Staff", "Job Opportunities," etc.) and then, if the user then selects "Products and Services" from the top menu, the side menu would change with a list of new links related to that one.
>
> Is this possible, and if so, how do I do this? Any help is appreciated!
>
> Thanks!
> Jason
>
Jason,
PHP is server side - to execute any PHP code, the client must make a
call to the server. While this can be done using Ajax, it requires
Javascript code on the client as well as PHP code on the server. As
such, I think it's a bit of overkill for what is basically static
information (the same info for the same menu item on each page).
You don't have to have the Javascript code in every page; it can be
included - and you don't even need PHP to do it. Try
comp.lang.javascript for more information.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|