How to set a variable in google apps script for a URL? I try this:

function getData() { var cell1 = "AHL-D"; var url = "http://quantumonline.com/search.cfm?tickersymbol="cell1"&sopt=symbol"; 

It does not work, it gives the error "There is a semicolon in front of the operator. (Line 3", Although everything seems to be a semicolon in place.

  • Where do you then var url = "http://quantumonline.com/search.cfm?tickersymbol=" saw ; ? Personally, I do not see. - 0-Level UNIX Monk
  • @ 0-LevelUNIXMonk, this is a linter error - it responds first. In general, he usually reports this when an operator is missing. Without it, the error will be Uncaught SyntaxError: Unexpected identifier . - oshliaer

1 answer 1

Probably

 function getData() { var cell1 = "AHL-D"; var url = "http://quantumonline.com/search.cfm?tickersymbol=" + cell1 + "&sopt=symbol"; ... }