Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

How can I show JSON information with Javascript on my HTML page?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I am practicing a bit with Javascript and JSON. But now I want to do something to make my code look better.

I am creating a website and a script that is showing one question at one website. When I click on 'Question 1' it shows one question at question.html. When I click on 'Question 2' it shows the one other question at question.html etc... I already have this piece of code.
What I would like to improve is that I am retrieving it from the JSON file, at the moment I'm retrieving it from my Javascript file. I already tried some things but I can't figure it out..

index.html



main.js


question.html


questions.js


questions.json


I hope someone can help me!
Thanks for the effort!




 
Ranch Hand
Posts: 97
AngularJS Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rico Papillon,

I am confused with use case why you are navigating to question.html once i selected question number. how can i select one more question option from question.html
 
Rancher
Posts: 500
6
IntelliJ IDE Spring Fedora
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly isn't happening that you want to happen?
 
I child proofed my house but they still get in. Distract them with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!