title: Dynamic URLs in CSS/JS
body: <p>I'm splitting up one of my larger apps and introducing a 'cdn' url to house common objects like CSS, javascript, and images to avoid duplication. What I need to do, though, is have separate URLs for our dev environments, so I may have:</p>
  
  <pre><code>http://cdn-dev.example.com
  http://cdn-qua.example.com
  http://cdn.example.com
  </code></pre>
  
  <p>depending on what environment we're working in. I can get this to work for things that are generated by our PHP code, but I'm at a loss for the .css and .js files that will be called. For example, how do I make something like:</p>
  
  <pre><code>.cool-button { background-image: url('http://cdn.example.com/images/button.png'); }
  </code></pre>
  
  <p>switch between the different domains?</p>
  
  <p>What's the best way to deal with that?</p>
  
  <p>[EDIT]</p>
  
  <p>Just so everyone is clear, the CDN address is a different domain that the site. So, the dev site might be <a href="http://www-dev.domain.com" rel="noreferrer">http://www-dev.domain.com</a> which would use <a href="http://cdn-dev.domain.com" rel="noreferrer">http://cdn-dev.domain.com</a></p>