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 8824571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:40:01+00:00 2026-06-14T06:40:01+00:00

Hello I am creating a simple website with just HTML/CSS and Javascript because I

  • 0

Hello I am creating a simple website with just HTML/CSS and Javascript because I can not use ServerSide languages ( server doesn’t support them) and now I am creating the routing of my website with jQuery/AJAX and even with my low Javascript knowledge I managed to create the most. But I cannot find out how to get the right index from my JSON file.

the JSON file is as follows:

{
  "home": {
      "pattern": "/home",
      "target":  "home.html"
  },
  "webshop": {
      "pattern": "/webshop",
      "target":  "webshop.html"
  }
}

and the jQuery that I used in my index.html is like:

<script type="text/javascript">
$(document).ready(function() {
//wacht op laden pagina

$.ajax({
  url: 'routing.json',
  async: false,
  dataType: 'json',
  success: function (response) {
    // do stuff with response.
    var nav = $('.nav_menu ul');

    $.each(response, function(route) {
        for(var i=0;i<route.length;i++){
        console.log("route["+i+"] is =>"+route[i]);
    }
        nav.append('<li><a href="index.html/#/' + route + '">' + route + '</a></li>');

    });

  }

});

});
</script>

Now is the problem that in my jQuery part I don;t know how to create the right links ( see the route )

nav.append('<li><a href="index.html/#/' + route + '">' + route + '</a></li>');
  • 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-06-14T06:40:02+00:00Added an answer on June 14, 2026 at 6:40 am

    Not sure why you have a further for loop in the $.each(). It is not necessary. Instead, try

    $.each(response, function(id,route) {
        nav.append('<li><a href="index.html/#/' + route.target + '">' + route.pattern + '</a></li>');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a simple website using HTML and JavaScript in dreamweaver. On my
I'm just starting to use Moose . I'm creating a simple notification object and
Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application
i'm creating a very simple (hello World quality) web application using spring mvc 3.0.
Hello I am creating a simple form to enter employee information. An employee has
Original Question: Hello, I am creating very simple hobby project - browser based multiplayer
I am creating my first, very simple RMI client-server application. Here is the code:
I'm creating a simple hello world vc++/opencv project. In my code, I want to
Hello I am creating a simple console application in vb.net in order to convert
I am creating a simple HTTP client/server application on my local machine but I

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.