Assessment wanted for Silly story generator for Leanne

Hi,

I was wondering if anyone can help me please.

I’ve checked over my code from other people’s assessments on here and from what I can see it looks correct but nothing is happening on the website.

Is anyone able to please help point out what I have missed.

Thank you.

This is my link below, but no space between / BaQ… not sure how you share the link properly from code pen as it came up with an error when i tried to just share the link as you can see below.

https://codepen.io/Leanne251/pen/ BaQEmBp

Hi @Leanne_Smith,
I think you are refering to the Silly Story Generator project at the end of Javascript first steps.

I have never shared a codepen so here is mine. Let me know if you can see mine. If you can share your code or the error you get maybe we can talk through the problem.

1 Like

Hi,

Thanks for the response. I checked my code with others and i think it looks right.

Thats why i was hoping someone could check mine to see which bit was wrong. Does the link i left work if you take out the space?

Thanks

https://codepen.io/Leanne251/pen/BaQEmBp

I thing you need to put your code like this using the hyperlink option and then it works. I am looking at it now and will get back.

Hi @Leanne_Smith
I dont want to take away the challenge of solving this from you so will point you to the right direction. On Codepen open up the console i.e. press F12. Then see what the error you get is. What I see is

Uncaught ReferenceError: newStory is not defined

So then ask yourself where are you initialising newStory? You asign the storyText to it but it then you also asign the newStory to the story.TextContent which is outside the function. Javascript is basicaly saying that the newStory is out of scope, i.e. it is undefined. Does this make sense?

Thanks so much for your help!!

I see a little extra sneeky curly bracket crept its way in there on one of my if statements and then the brackets were not closed for the function.

Thanks so much for the hint! it was a big help :slight_smile:

On to chapter 2!

Excellent. Good luck and enjoy.