WhatsApp-Chat-Analyzer | WhatsApp Chat Analyzer is a WebApp and it can be | Data Visualization library
kandi X-RAY | WhatsApp-Chat-Analyzer Summary
kandi X-RAY | WhatsApp-Chat-Analyzer Summary
WhatsApp Chat Analyzer is a WebApp and it can be used by anyone to analyze their chat.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Reads data from a file
- Parse a line and return a data point
- Check if string starts with author name
- Check if a string starts with date time
- Visualize popular emoji
- List of popular emoji
WhatsApp-Chat-Analyzer Key Features
WhatsApp-Chat-Analyzer Examples and Code Snippets
Community Discussions
Trending Discussions on WhatsApp-Chat-Analyzer
QUESTION
I am currently writing a WhatsApp-Chat-Analyzer. Therefore, I have to loop through the chat's participants and create buttons each representing one participant. When creating those buttons parameters or variables have to be handed over to a function which then executes code that further processes the parameters/variables.
However, regardless of what I am trying, the function that is called when clicking the button does not use the right variable; it always uses the first one of the array which is used to loop-over in the for-loop.
At the same time, printing out the variables while creating the buttons does work properly - all the unique variables are printed out and not only the first one.
As far as I know, all this indicates that there is something wrong with the scopes.
Coming from Java, working with javascript variables is very confusing since some of them appear to be global even though they are declared within a function or a loop. That's why I have tried to enclose the function that is handed over to the dynamically created button. Sadly, setting up a function that returns another function and handing over the first function does not work although it actually should work.
Furthermore, I am aware of the fact that "let" should be used in this case instead of "var" to create a local variable.
The following code represents what I am doing and which solution I have tried so far.
...ANSWER
Answered 2019-Sep-09 at 01:29The problem is that you have duplicate IDs in the HTML. Here's a more minimal example (click on the labels, and watch which button gets clicked):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install WhatsApp-Chat-Analyzer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page