Home > Software design >  How can i update my template using javascript?
How can i update my template using javascript?

Time:03-28

I started web development last month. I'm working on a university project of movies website. i made a movie-play-page.html for one movie and linked it through href. I want to update that template for every movie by changing src only. please help me how can i do this?. any youtube video?

CodePudding user response:

Here come React js , its a component based JavaScript libary , reusability of one component in many ways. You can explore more on here https://reactjs.org/. If you want to used without react.It will become lengthy because you have to make seperate movie play html and link with href pages for every movie . I hope it clear what you want

CodePudding user response:

You can store the movie source into an array, then iterate over it with a forEach function.

read up on forEach method

  • Related