+ 4

Typing Effect

The code works except one small problem, whenevr i use text like Lorem Ipsum and i copy and paste that into my code it does something strange, it doesnt fully type the text. Any clues on how to fix this? https://code.sololearn.com/WoSTUTdpj0Ob/?ref=app

17th Mar 2022, 9:02 PM
Junior
Junior - avatar
21 Answers
+ 2
Did you type in a text longer than 100 characters? There's a maximum of input characters, at least in sololearn...
17th Mar 2022, 9:28 PM
Lisa
Lisa - avatar
+ 1
onload just makes sure that the js is executed when the html is loaded
17th Mar 2022, 11:19 PM
Lisa
Lisa - avatar
+ 1
use window.onload when you are using Sololearn's javascript tab. It makes sure that the html is loaded first, so it can find the DOM elements.
18th Mar 2022, 2:39 AM
Bob_Li
Bob_Li - avatar
0
It's trying to get the html element before it is loaded. Put all the js inside of window.onload = function() { // your js }
17th Mar 2022, 9:06 PM
Lisa
Lisa - avatar
0
Its still not working
17th Mar 2022, 9:08 PM
Junior
Junior - avatar
0
I entered "Hello world" and ut was typed
17th Mar 2022, 9:13 PM
Lisa
Lisa - avatar
0
No but if u typed in the Loreum Ipsum the thing kindof just breaks
17th Mar 2022, 9:24 PM
Junior
Junior - avatar
0
I just tried with 99 charcters and its still doing it, it could do with the amount of lines or something
17th Mar 2022, 9:33 PM
Junior
Junior - avatar
0
Maybe newline characters? You could try to remove them from the string before the animation starts
17th Mar 2022, 9:34 PM
Lisa
Lisa - avatar
0
Okay, heres a better example, when you put into the prompt box and say “This is my demo” it will not make the demo come out, try it and youll see
17th Mar 2022, 9:59 PM
Junior
Junior - avatar
0
Why did you remove window.onload? Now I get the same type error as in the beginning
17th Mar 2022, 10:03 PM
Lisa
Lisa - avatar
0
Ye, sorry forgot to save but it still dont work
17th Mar 2022, 10:04 PM
Junior
Junior - avatar
0
Seems to work for me? Which error message exactly do you get?
17th Mar 2022, 10:05 PM
Lisa
Lisa - avatar
0
It didnt give me an error message it just stops the whole thing, did you type what i said? Lisa
17th Mar 2022, 10:39 PM
Junior
Junior - avatar
0
What do you mean "it stops"? The text gets typed, then it stays on screen.
17th Mar 2022, 10:44 PM
Lisa
Lisa - avatar
0
Ok, ye its workinng fine i was using mobile but i just tried it in pc and its working fine
17th Mar 2022, 10:49 PM
Junior
Junior - avatar
0
So each time i have an element i have to use window.onload?
17th Mar 2022, 10:54 PM
Junior
Junior - avatar
0
hi mom when did u start programming
18th Mar 2022, 8:33 AM
😎_M_😎
😎_M_😎 - avatar
0
Java script project 1/6 already finished, but project two not active and i didn't gain java script certficate.
18th Mar 2022, 3:28 PM
Ermiyas
0
Your Mom Sololearn seems to have a limit on the length of the input in the prompt... maybe use a text input element instead? something like this: https://code.sololearn.com/WZPr0l9yHZaF/?ref=app
19th Mar 2022, 6:54 AM
Bob_Li
Bob_Li - avatar