Buttons do not respond only when first opened

Asked 1 years ago, Updated 1 years ago, 32 views

I created the following site on GitHub Pages.
https://imaimai17468.github.io/Products/CreditsCounterforKNCT/

Here is the repository.
https://github.com/imaimai17468/imaimai17468.github.io/tree/b6a86cc89b78319dc7963e27385dbf63148bb85b/Products/CreditsCounterforKNCT

"Why does the ""In"" and ""Uncheck"" buttons for each subject on this site only work when it is opened for the first time, and it works when it is reloaded?"
I'm very sorry, but I don't understand the exact timing of this occurrence, and I only know that if I open this site as a separate tab, it will occur.

The contents of each department (buttons, tables, etc.) are developed using javascript, so I thought it was based on the order of application, but it was not resolved.

I checked the same phenomenon on iPhone safari and Chrome.
Chrome version is 99.0.4844.74 (as is Chrome on iPhone)
The iPhone operating system is iOS 15.3.1
That's it.

I would appreciate it if someone could tell me.Thank you for your cooperation.

javascript html

2022-09-30 17:12

1 Answers

We are sorry for the inconvenience caused to all of you who commented.I'm sorry.

First of all, when I opened this site after erasing the history, I was able to see this phenomenon, so I debugged it in that state.I still don't know the detailed reproduction conditions.I'm sorry.

"When I pressed ""Check required subjects"" in M course, the check box for other required subjects was checked."
As a result of investigating the cause, we found that there was a problem with how to attach the class to the check box in the list of subjects.
I set up the class with output_csv.js, but the class related to the department was obtained by putting the index corresponding to each department in the array department.

department[0]='m'
department[1] = 'e'

and so on.
This index was managed by a variable called department_count, which caused this problem.
It was originally assumed that this variable should be declared as a global variable, initialized to 0, incremented sequentially every time the getCsvData and convertArray functions were read, and the corresponding class of the department was added.
However, perhaps because of the declaration as a global variable, this value was misaligned, and the class of E was attached to the part where I wanted to attach the class of M department, so I attached the class of other departments to the original department.

As a solution, we decided to have the arguments of getCsvData and converterArray functions have an index corresponding to the department.I don't think this problem will occur, but I am very sorry if the same problem occurs again.
Thank you very much for all your help this time.


2022-09-30 17:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.