1

I am trying to build a website for an escape room. So, there will be a problem within a Bootstrap card and every time a problem is solved, I want the Boostrap card to change. I've tried this using EJS, but I've ran into the problem that you cannot update EJS without reloading the webpage, which I don't want to do.

I also don't want to have to manually type out each and every jQuery replace method every time a problem is solved because there will be a lot of problems.

So, I am wondering whether there is a package for node.js or something I am missing that lets me update the card and some information on the side without reloading the page every time. Also, is there code for the client-side js that would let me replace certain blocks of html code like you can do with EJS?

Webpage Image This is what the webpage will look like. I am trying to replace all of the information on the card or just the card itself. I also want to add the the game information on the side, like the CEO name or the amount of money they have.

Any suggestions will help. Thank you.

  • Can you share some code? – Daniel Ehrhardt Jul 27 '21 at 23:47
  • The problem was I didn't have any code to go off of, but I found the answer. I just had to use the AJAX load() method. – Skittlez1522 Jul 28 '21 at 00:40
  • NodeJs only runs on the server, what you are trying to achieve is client side. You may want to consider Single Page Application (SPA) frameworks like ReactJs [https://reactjs.org/](https://reactjs.org/), VueJs [https://vuejs.org/](https://vuejs.org/) or Angular [https://angular.io/](https://angular.io/) which are specifically built to solve these client side rendering problems. Or you can roll your own with HandlebarsJs and JQuery [https://handlebarsjs.com/guide/](https://handlebarsjs.com/guide/) – Nick Mitchell Jul 28 '21 at 06:28

0 Answers0