/    Sign up×
Community /Pin to ProfileBookmark

a Javascript menu problem

Hello Everybody,

I am trying to “break the code” and understand a javascript menu that I received.
As it stands, everything works “OK” but I want to tweak this thing. (What happens is each page-change link will load a complete new page, including this menu I refer to)

The menu is a simple four button group, that will “expand” and “contract” as a viewer clicks on the button. Each button has an “attached” unordered HTML list, and if the viewer selects and clicks one of the links… a whole new page will display, as I said.
The thing is, although it may be a “[I]Whole New Page[/I]“, that menu is sometimes drawn in an extended form, and sometimes not. Aieeeeeeyah!

[B]My question is:[/B] How would PageX.shtml even “KNOW” how to make the menu appear differently… the only comment about the menu in any of the pages is all the same:
<TD>
<!– #INCLUDE FILE=”header.inc” –>
</TD>

Any help would be appreciated. I want to eventually control how a page opens… with an extended menu or with a contracted menu

Many thanks…
-Paul-

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@MongusJun 21.2005 — That comment isn't really a comment at all. It's a server side include. Look into the "header.inc" file.
Copy linkTweet thisAlerts:
@UltimaterJun 21.2005 — You can send it a query string.

PageX.shtml?aVarible=somethingElse

Then you can look at the query string in the PageX.shtml using

location.search

Which will contain the string you are looking for.
Copy linkTweet thisAlerts:
@jPaulBauthorJun 22.2005 — Thanks Mongus and Ultimater,

I did look to the "header.inc" file... but all it does is refer to an image file.

<img src="img/header.jpg" alt="www.MySite.com" border="0"><br><br>

What is it I would be looking "for"?

I've also hunted for something similar to Ultimater avdice, but could find and kind of "trigger" similar to:


You can send it a query string.

PageX.shtml?aVarible=somethingElse

Then you can look at the query string in the PageX.shtml using

location.search

Which will contain the string you are looking for.[/QUOTE]


Would it help if I included the code that I have?

-Paul-
Copy linkTweet thisAlerts:
@DaiWelshJun 22.2005 — When you looked at the header.inc file, did you look at a local copy with a text editor or did you look at an online version with a browser? It seems unlikely that that would be the only thing in the file, unless there are other similar includes elsewhere in the page?
Copy linkTweet thisAlerts:
@jPaulBauthorJun 22.2005 — Thanks for your reply DaiWelsh,

There are three includes:

header.inc

LeftNav.inc

Footer.inc

Both the "Header.inc" and "Footer.inc" refer to an image file, and use <BR> tags.

Have no idea why line breaks

The "LeftNav.inc" simply seems to contains four major buttons, each with an "Expandable"/"Contractable" unordered list that displays the choices a viewer can make.

When a viewer 'does' select a new page... the Menu is usually represented in a collapsed state... usually because there are times when the menu is drawn in the same form it was when the new page was selected.

My issue is that I can not understand why? and naturally I want to control that action myself.
Copy linkTweet thisAlerts:
@DaiWelshJun 22.2005 — The "LeftNav.inc" simply seems to contains four major buttons, each with an "Expandable"/"Contractable" unordered list that displays the choices a viewer can make.[/QUOTE]

Might help to see the contents oft hat file and also the actual javascript for the menu (unless it is one of those 20 page scripts :eek: )

When a viewer 'does' select a new page... the Menu is usually represented in a collapsed state... usually because there are times when the menu is drawn in the same form it was when the new page was selected.[/QUOTE]

Lost me there, I can't make head or tail of that sentence. :p Do you have an online example that we can look at to see what behaviour you are refering to?
Copy linkTweet thisAlerts:
@jPaulBauthorJun 22.2005 — Thanks,

What I meant to say is that: Although each page appears to load the menu with the same instruction:

<TD>

<!-- #INCLUDE FILE="header.inc" -->

</TD>

Some pages load with the menu extended, and other pages load with the menu collapsed.

I've attached the two files:

[upl-file uuid=bd2cc565-8a36-4dda-a7c5-493f52d748bc size=2kB]MenuFiles.zip[/upl-file]
×

Success!

Help @jPaulB spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...