Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup #5

Open
jonalange opened this issue Mar 26, 2021 · 0 comments
Open

Setup #5

jonalange opened this issue Mar 26, 2021 · 0 comments

Comments

@jonalange
Copy link

I'm really new to JS and I'm at the very beginning of learning. So this might be a "dumb" question.
But how do I set up the array correctly in this case?

I've put this in my <head>

    <script>   
    var forceFeed = new Array();
    window.words = ['lorem', 'ipsum', 'dolor', 'sit', 'amet', 'adipsing', 'consectetur', 'elit', 'sed', 'commodo', 'eu', 'ligula', 'vitae', 'mollis'];
    window.sentences = ['Curabitur tempus lobortis faucibus.', 'Nulla sed consequat libero.', 'Phasellus bibendum neque eros, vel malesuada ligula fermentum et.', 'Vivamus pretium vulputate imperdiet.', 'Morbi eleifend urna ac purus auctor, non porttitor massa semper.', 'Ut tempor ante et mauris sagittis, sed vestibulum urna rhoncus.', 'Mauris quis augue fermentum, auctor metus quis, imperdiet lectus.', 'Morbi nec rhoncus lectus.',  'Nulla cursus venenatis urna maximus bibendum.', 'Cras at ornare tortor.', 'Nulla nulla justo, posuere id ultricies non, feugiat et nisi.', 'Duis porttitor aliquet viverra.', 'Integer vehicula fringilla velit, at iaculis dolor imperdiet vel.'];
    forceFeed({words: window.words, sentences: window.sentences});
    </script>

And of course this isn't working, because forceFeed is not a function. But I can't come up with anything else how I should "execute" it as you describe it.

After that, I put your script as you said after my content, before the </body>

Maybe you could help me out here.
I know I have to learn JS and thats what I do, but as I said, I just started.

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant