D
D
DragonPro2022-01-25 21:58:29
JavaScript
DragonPro, 2022-01-25 21:58:29

I need to open a JSON file in HTML, what is the correct way?

There is such line in JavaScript - "this.$store.dispatch("app/fetchDataFrom", this.url + "?slider_id=" + this.sliderId)"
Under url = "/xhr/productsliders/". The HTML code is < products-slider slider-id="14" >< /products-slider >.
The json file is loaded from this url with the name "slider_id=14" i.e. in theory, the script should open the json file at the url "/xhr/productsliders/?slider_id=14", but for some reason it does not open and I have a question, what needs to be added to make it work, maybe rename the file somehow or add something -either in a script, don't understand it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chincharovpc, 2022-01-25
@DragonPro

I think you need to get the json first with javascript and then display it in html
Link if I understood you correctly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question