I am currently working on a script that involves extracting a string from a textarea, breaking it down into an array using the delimiter "=====\n", and then displaying each element of the array in the textarea every 250ms. However, I have noticed that whenever I click the button to initiate this process, the webpage freezes.
As someone who is new to JavaScript, I would greatly appreciate any advice or assistance.
Here is what I have attempted so far:
The function to trigger with setInterval (theStage represents the textarea):
function start(){
var frames = theStage.value.split("=====\n");
while(true){
for(var i = 0; i < frames.length; i++){
theStage.value = frames[i];
}
}
}
Timer function:
function changeFrame(){
var time = setInterval(start, 250);
}