By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,382 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,382 IT Pros & Developers. It's quick & easy.

design question

P: n/a
Hi, I have a general design questions. I'm making a site that has two
frames, one on the left for navigational menus and one on the right
for displaying the contents of the site. I want some of the menu items
on the left to expand dynamically and display sub items when the user
clicks on them. So they might show something like this:
item 1
item 2
item 3

then when you click on item 2 you get this:

item 1
item 2
sub item 2.1
sub item 2.2
item 3

I was going to put all the javascript in just the menu pages so that
when you click on one of the expandable menu items, it loads another
static page into the left frame with that menu item expanded. I know
that may not be the best solution especially if we decide to have more
than one expandable menu item, but that's the way it's going to work
for now.
This would have worked fine except that some pages allow the user
to access other pages without using menu on the left. The problem
there is that if a page that isn't part of an expanded menu item takes
you to another page that *is* part of an expanded menu item, the menu
won't expand, since the javascript only runs if you click the menu
item hyperlinks in the left pane.
This problem can be solved in at least a few ways. I could take the
javascript out of the menu pages and put it in the onLoad event of
every display page so that when that page displays, it changes the
left frame to display the proper menu for that page (expanded or
collapsed). Or I could connect the javascript to the hyperlinks that
move you from pages with collapsed menus to pages with expanded menus.
Neither of those solutions sounds all that good because every time you
right a new page you have to remember to put the javascript in there
if it's going to affect the menu frame. Is there any other way of
doing this that I might be missing? Something that won't turn into a
maintenance nightmare?

Thanks
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Unfortunately I don't have a choice.

William Starr Moake <ws*****@yahoo.com> wrote in message news:<va********************************@4ax.com>. ..
The instant I read the word "frames" my eyes glaze over, my brain
turns to oatmeal and drool runs down my slack jaw. Don't use 'em.
Don't want to read about anyone else who does.
On 11 Jul 2003 10:51:17 -0700, he******@aol.com (headware) wrote:
Hi, I have a general design questions. I'm making a site that has two
frames, one on the left for navigational menus and one on the right
for displaying the contents of the site. I want some of the menu items
on the left to expand dynamically and display sub items when the user
clicks on them. So they might show something like this:
item 1
item 2
item 3

then when you click on item 2 you get this:

item 1
item 2
sub item 2.1
sub item 2.2
item 3

I was going to put all the javascript in just the menu pages so that
when you click on one of the expandable menu items, it loads another
static page into the left frame with that menu item expanded. I know
that may not be the best solution especially if we decide to have more
than one expandable menu item, but that's the way it's going to work
for now.
This would have worked fine except that some pages allow the user
to access other pages without using menu on the left. The problem
there is that if a page that isn't part of an expanded menu item takes
you to another page that *is* part of an expanded menu item, the menu
won't expand, since the javascript only runs if you click the menu
item hyperlinks in the left pane.
This problem can be solved in at least a few ways. I could take the
javascript out of the menu pages and put it in the onLoad event of
every display page so that when that page displays, it changes the
left frame to display the proper menu for that page (expanded or
collapsed). Or I could connect the javascript to the hyperlinks that
move you from pages with collapsed menus to pages with expanded menus.
Neither of those solutions sounds all that good because every time you
right a new page you have to remember to put the javascript in there
if it's going to affect the menu frame. Is there any other way of
doing this that I might be missing? Something that won't turn into a
maintenance nightmare?

Thanks

Jul 20 '05 #2

P: n/a
headware wrote:
Hi, I have a general design questions. I'm making a site that has two
frames, one on the left for navigational menus and one on the right
for displaying the contents of the site. <snip> This would have worked fine except that some pages allow the user
to access other pages without using menu on the left. The problem
there is that if a page that isn't part of an expanded menu item takes
you to another page that *is* part of an expanded menu item, the menu
won't expand, since the javascript only runs if you click the menu
item hyperlinks in the left pane.
This problem can be solved in at least a few ways. I could take the
javascript out of the menu pages and put it in the onLoad event of
every display page so that when that page displays, it changes the
left frame to display the proper menu for that page (expanded or
collapsed). This has potential in that pages could include common code to cause menu
update based on their URL. I would not, however, attempt to get document
page code to *perform* menu update. More some kind of notification to
let frameset or contents page code know that the document frame URL has
changed.

Or I could connect the javascript to the hyperlinks that move you from pages with collapsed menus to pages with expanded menus. Bad idea, no disagreement. Horrible maintenance problem.
Neither of those solutions sounds all that good because every time you
right a new page you have to remember to put the javascript in there
if it's going to affect the menu frame. Is there any other way of
doing this that I might be missing?

I have used the 'notification' solution with no action taken if the
notified URL is not in the menu. Essentially common menu interface code
goes in a template file for frameset documents.

Another idea might be to run a timer script in either the frameset or
contents page which checks for *changes* in the url of the document
frame, and if an inactive menu link points to it, update the menu frame.
This suggests even static menu pages loaded from the server need to know
where hidden menu links lead.

There might be a small delay before menus update themselves (which is
exactly what I think menus should do) but this might actually be better
than page loading scripts using a notification scheme - clicking a menu
item to load a document frame can cause duplicate tracking if menu item
click and page loading both trigger contents tracking without additional
code to prevent the duplication.

Obviously a fully expanded contents page should be loaded initially by
the frameset for use in javascript disabled browsers.
Hope it helps,
Dom


Jul 20 '05 #3

P: n/a
Thanks for the reply. Those are good suggestions. But, why do you
think it's a bad idea for the document page to do the actual changing
of the menu page? All it would really require is some simple code like

parent.menu.location = "MyMenu.aspx";

Do you think this could lead to maintenance issues?

Thanks,
Dave

Dom Leonard <do*************@senet.andthis.com.au> wrote in message news:<YB*****************@nnrp1.ozemail.com.au>...
headware wrote:
Hi, I have a general design questions. I'm making a site that has two
frames, one on the left for navigational menus and one on the right
for displaying the contents of the site.

<snip>
This would have worked fine except that some pages allow the user
to access other pages without using menu on the left. The problem
there is that if a page that isn't part of an expanded menu item takes
you to another page that *is* part of an expanded menu item, the menu
won't expand, since the javascript only runs if you click the menu
item hyperlinks in the left pane.
This problem can be solved in at least a few ways. I could take the
javascript out of the menu pages and put it in the onLoad event of
every display page so that when that page displays, it changes the
left frame to display the proper menu for that page (expanded or
collapsed).

This has potential in that pages could include common code to cause menu
update based on their URL. I would not, however, attempt to get document
page code to *perform* menu update. More some kind of notification to
let frameset or contents page code know that the document frame URL has
changed.

Or I could connect the javascript to the hyperlinks that
move you from pages with collapsed menus to pages with expanded menus.

Bad idea, no disagreement. Horrible maintenance problem.
Neither of those solutions sounds all that good because every time you
right a new page you have to remember to put the javascript in there
if it's going to affect the menu frame. Is there any other way of
doing this that I might be missing?

I have used the 'notification' solution with no action taken if the
notified URL is not in the menu. Essentially common menu interface code
goes in a template file for frameset documents.

Another idea might be to run a timer script in either the frameset or
contents page which checks for *changes* in the url of the document
frame, and if an inactive menu link points to it, update the menu frame.
This suggests even static menu pages loaded from the server need to know
where hidden menu links lead.

There might be a small delay before menus update themselves (which is
exactly what I think menus should do) but this might actually be better
than page loading scripts using a notification scheme - clicking a menu
item to load a document frame can cause duplicate tracking if menu item
click and page loading both trigger contents tracking without additional
code to prevent the duplication.

Obviously a fully expanded contents page should be loaded initially by
the frameset for use in javascript disabled browsers.
Hope it helps,
Dom

Jul 20 '05 #4

P: n/a
headware wrote:
Thanks for the reply. Those are good suggestions. But, why do you
think it's a bad idea for the document page to do the actual changing
of the menu page? All it would really require is some simple code like

parent.menu.location = "MyMenu.aspx";

Do you think this could lead to maintenance issues?


In the sense that the document page has hard links to its associated
menu page, yes. I think it preferable for javascript code to derive the
menu page from parsing the document URL in which the code is running.

So if the document url looks like "http://...blah.../page1.html
and code parses out the 'page1' bit into a pageName variable, the above
code might become

parent.menu.location = pageName + "Menu.aspx"; // or
parent.menu.location = "sendMenu.asp?caller=pageName";

A common javascript file can then be included in document pages to
update the menu. Hard coding may be fine for a few pages, but does not
scale well and requires the navigation system to stay constant.

I have found a common .js file is a good idea anyway. I wanted to add a
frame breakout script? Reload under Netscape 4.xx after resize? Create
and add a document footer element? Easy with a common file :)

Cheers,
Dom

Jul 20 '05 #5

P: n/a
I see. Yeah those are good ideas. Thanks for the help.

Dave
Dom Leonard <do*************@senet.andthis.com.au> wrote in message news:<fy***************@nnrp1.ozemail.com.au>...
headware wrote:
Thanks for the reply. Those are good suggestions. But, why do you
think it's a bad idea for the document page to do the actual changing
of the menu page? All it would really require is some simple code like

parent.menu.location = "MyMenu.aspx";

Do you think this could lead to maintenance issues?


In the sense that the document page has hard links to its associated
menu page, yes. I think it preferable for javascript code to derive the
menu page from parsing the document URL in which the code is running.

So if the document url looks like "http://...blah.../page1.html
and code parses out the 'page1' bit into a pageName variable, the above
code might become

parent.menu.location = pageName + "Menu.aspx"; // or
parent.menu.location = "sendMenu.asp?caller=pageName";

A common javascript file can then be included in document pages to
update the menu. Hard coding may be fine for a few pages, but does not
scale well and requires the navigation system to stay constant.

I have found a common .js file is a good idea anyway. I wanted to add a
frame breakout script? Reload under Netscape 4.xx after resize? Create
and add a document footer element? Easy with a common file :)

Cheers,
Dom

Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.