title: Get a string in a variable to create a dynamic link in Javascript
body: <p>What I am trying to accomplish is to have a map that has a few locations. Whenever users click on each location, a popup will emerge with some information. I am trying to create a dynamic link inside that popup. </p>
  
  <p>Below is my code in Javascript</p>
  
  <pre><code>function parseDescription(message){
      var string=""
  
      for(var i in message){
          if (i=="CommunityPartner"){
              string+='&lt;span style="font-weight:bold"&gt;'+i+'&lt;/span&gt;'+": "+message[i]+'&lt;/a&gt;'+"&lt;br&gt;"
          } else if (i=="WeitzCECPartner"){
              string+='&lt;span style="font-weight:bold"&gt;'+i+'&lt;/span&gt;'+": "+message[i]+'&lt;/a&gt;'+"&lt;br&gt;"
          } else if (i=="PhoneNumber"){
              string+='&lt;span style="font-weight:bold"&gt;'+i+'&lt;/span&gt;'+": "+message[i]+'&lt;/a&gt;'+"&lt;br&gt;"
          } else if (i=="Website"){
              var link = "http://www."+message[i];
              string+='&lt;span style="font-weight:bold"&gt;'+i+'&lt;/span&gt;'+": "+'&lt;a href="{{link}}" &gt;'+link+'&lt;/a&gt;'+"&lt;br&gt;"
          }
          //string+='&lt;span style="font-weight:bold"&gt;'+i+'&lt;/span&gt;'+": "+message[i]+"&lt;br&gt;"
      }
      return string;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5mWdw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5mWdw.png" alt="enter image description here"></a></p>
  
  <p>I keep getting this error. I think it's related to the value passed into "a href" : </p>
  
  <pre><code>Request Method: GET
  Request URL:    http://127.0.0.1:8000/%7B%7Blink%7D%7D
  </code></pre>
  
  <p>Please help</p>