question

lu.zhang@sectionstudios.com avatar image
lu.zhang@sectionstudios.com asked

Error happens when define string variable in Cloud Storage

When I try to submit the Cloud Script code to the server, the system mentions me the following error. I am confused. Is there any syntax error in the following string variable definition progress? The error code is just 'var c= "c";'

  • SyntaxError: Unexpected token ILLEGAL at Script Document [3]:6:11 -> var c = “c”;
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The quote marks in your example are so-called "curly" quote marks, which aren't valid as a way to provide a string value in JavaScript. You need to use vertical quote marks, like this: "

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lu.zhang@sectionstudios.com avatar image
lu.zhang@sectionstudios.com answered

Thank you for the mention. How can I type the vertical quote marks? I am editing the Js file by using the Mac's TextEdit application. Shall I use any professional Js editing application?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

I've seen two possible solutions:

1. In TextEdit select all your text by pressing ⌘ Cmd-A and then go to Edit > Substitutions and uncheck Smart Quotes.

2. In System Preferences > Keyboard, select Text sub-menu. On the right-hand side of the box, uncheck the "Use smart quotes and dashes" box.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lu.zhang@sectionstudios.com avatar image
lu.zhang@sectionstudios.com answered

It works :) Thank you so much for the patient response!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.