I cant do step 49 of javascript role playing game due to freezing up

the program keeps freezing up and it wont tell me if its right or wrong and it wont show the green and the congrats message despite it being right, it just stays frozen still i tried everything, clearing my cache, restarting my computer, disabling ad blockers

Can you please share your code? It looks like you may have a syntax error

text.innerText = "You are in the town square. You see a sign that says \"Store."\;

i meant to add a backslash before the quote and fter the quote but its not going through EDIT: I have no idea whats going on with my computer

It’s not your computer, you need to format code correctly

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

you are missing a quote here, make sure you escape the right quote, this is a syntax error making the javascript not work for now

its still freezing up

what is your code now?

function goTown() {
  button1.innerText = "Go to store";
  button2.innerText = "Go to cave";
  button3.innerText = "Fight dragon";
  button1.onclick = goStore;
  button2.onclick = goCave;
  button3.onclick = fightDragon;
  text.innerText = "You are in the town square. You see a sign that says \"Store."\;

I put a slash behind the quote and ahead of the last quote its not posting for some reason

for the code to show properly you need to use backticks as I said before

you still are missing the quote at the end of the string, and that one you ahve is not escaped property, the slash needs to be before the quote

how do you use backticks

Like I wrote before 

 text.innerText = "You are in the town square. You see a sign that says 
 \"Store."\;

still not working

now its not even showing the backticks. The hell is wrong with my computer. I put 3 backticks before in the previous line and 3 after

You keep writing the same thing, and I will keep saying the same thing: you can’t have a slash outside the string, a character is escaped putting the slash before the character. You need one escaped quote just after the o in Store, and one not escaped after the period

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.