title: How to read dynamic url from JSON file?
body: <p>I have a .json file (see below) with image URL containing variables like the path and the project name.</p>
  
  <pre><code>{"imgs":[
  {
   "gatewayImg": "resrcPath+_global_PROJECT_NAME+'/images/gateway-'+_global_PROJECT_NAME+'.png'"
  }
  ]}
  </code></pre>
  
  <p>I also have my ajax request loading the file and on my request success I assign the attribute src and the source path to the image. </p>
  
  <pre><code>  $.ajax({
       async: false,
       type: "GET",
       global: false,
       dataType: "json",
       url: resrcPath+"imgRes.json",
       success: function (data) {
        var src = data.imgs[0].gatewayImg;
        $('.gatewayImg').attr('src', src);
       }
   });
  </code></pre>
  
  <p>The problem is that when the I do this, the image isn't found on the local server and I get this <code>localhost:8080/order/resrcPath+_global_PROJECT_NAME+'/images/gateway-'+_global_PROJECT_NAME+'.png'</code> as the src.</p>
  
  <p>But when I attribute the src as followed: <code>$('.gatewayImg').attr('src', resrcPath+_global_PROJECT_NAME+'/images/gateway-'+_global_PROJECT_NAME+'.png');</code> the image shows up and the variables are well replaced by their correct value.</p>
  
  <p>I don't know if my JSON is valid or not that way, and I need to know how to assign the src with the json value instead of writing the URL in the attribute function.</p>