title: How to load different stylesheets depending on the previous URL
body: <p>Our business network uses the same PHP booking system for each venue and all of our online bookings. At the moment, the booking system is styled in a really bland fashion, and as all of our venues have their own website, with their own styles, there is no continuity when clicking "book now" from a site, and loading the booking system.</p>
  
  <p>I'm wondering if there is a way that we can put some javascript on the booking system landing page, that can load external stylesheets, depending on which URL the customer clicked through from.</p>
  
  <p>Ideally something like</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  if(window.location.search.indexOf('example1.co.uk') === 0)
      document.write("&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"style1.css\" /&gt;");
  &lt;/script&gt;
  
  &lt;script language="javascript" type="text/javascript"&gt;
  if(window.location.search.indexOf('example2.co.uk') === 0)
      document.write("&lt;link rel=\"stylesheet\" type=\"text/css\" href=\"style2.css\" /&gt;");
  &lt;/script&gt;
  </code></pre>
  
  <p>This doesn't seem to work though. Any help would be appreciated!</p>