Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 208463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:49:40+00:00 2026-05-11T17:49:40+00:00

I have some mega menu style menus on a site I maintain. These are

  • 0

I have some “mega menu” style menus on a site I maintain. These are essentially a set of nested <UL>s. Since there are about 150 to 200 entries in the complete menu, it adds a lot of bulk to the page and makes screen readers painful.

I plan to change the menus so that only the top level of the menu is output on the page, which will cut out 99% of it, and will remain usable in non-javascript clients.

If javascript is available, I plan to replace the simple top level menu, with the complete mega menu. Ideally, the complete menu would be stored in the javascript file, as this will have the added benefit of letting the browser cache it (it does not change often).

My question is, how would people recommend I store the complete menu in the javascript file. At the moment I just have something like…

var menuhtml = '<ul id="megamenu"><li>blar blar...</ul>';
$("#megamenu").html(menuhtml);
// more code here to get the menu to work as needed

This seems kind of ugly. The obvious answer would be to fetch the menu html via an ajax request, but this would only work if I can be sure it will be cached, as I don’t want any additional http requests if I can help it.

If anyone has any good suggestions on getting a clean solution, please let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:49:40+00:00Added an answer on May 11, 2026 at 5:49 pm

    What you could do is have serve, if you have a server-side programming, is a JSON JavaScript file with the navigation. This would be cached by the browser and then the JSON can be used to construct a menu.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some UI in VB 2005 that looks great in XP Style, but
Have some task with Infragistics UltraGrid requirement. Found Infragistics controls' list on their site,
I have built a mega menu, where when you click on the nav link
I have some ASP.NET web services which all share a common helper class they
I have some code for starting a thread on the .NET CF 2.0: ThreadStart
We have some input data that sometimes appears with &nbsp characters on the end.
I have some classes layed out like this class A { public virtual void
I have some C# / asp.net code I inherited which has a textbox which
I have some code like this in a winforms app I was writing to
I have some kind of test data and want to create a unit test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.