Answer the question
In order to leave comments, you need to log in
How to solve the problem with Cyrillic in JSON?
There is a draft page where the user:
1. selects the city, displaying the event plan
2. selects the time of the event in the event, displaying the description of the individual event
In paragraph 2, the formula is used:
...
newContent += times[loc][i].title.replace(/ /g, '-') + '">';
..
{
"CA": [
{
"time": "9:00",
"title": "3D-моделирование"
},
...
3D-моделирование
) in the html file and displays the description on the page (in this case, it does not work, since the identifier is in Latin - Intro-to-3D-Modeling):...
<div id="Intro-to-3D-Modeling">
<h3>3D-моделирование</h3>
<p>Описание</p>
</div>
...
Answer the question
In order to leave comments, you need to log in
I didn't look at the attached file, but on the very issue I feel that you are doing nonsense.
Iterate over all h3s on the page, the one whose text matches your title - get the parent element. No id, and the text can be arbitrary.
I do not welcome this method, but perhaps it will be more convenient for you to organize the output of information in a block that bears the name of the object
{
"CA": [
{
"time": "9:00",
"title": "3D-моделирование"
},
...
<div id="CA">
<h3>3D-моделирование</h3>
<p>Описание</p>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question