title: How do I allow CORS requests on mediawiki?
body: <p>I tried adding <code>$wgCrossSiteAJAXdomains = array( '*' );</code> to LocalSettings.php, but didn't work.</p>
  
  <p>I am trying to add content created by an external server. The snippet below shows how I want to show the value of a parameter (I am planning to serve more complex content that I can only build on the external server.)</p>
  
  <p>I added the following code to MediaWiki:Common.js:</p>
  
  <pre><code>$.each($('.from-outside'), 
         function(index, element) {
           element = $(element);
           paramName = element.attr('param-name');
           console.log('Loading ' + paramName + '...');
           element.load('http://outside.domain/get_value/' + encodeURIComponent(paramName));
         });
  </code></pre>
  
  <p>Then the following content on a template:</p>
  
  <pre><code>&lt;html&gt;
  &lt;div class="from-outside" param-name="param one"&gt;&lt;i&gt;Loading...&lt;/i&gt;&lt;/div&gt;
  &lt;/html&gt;
  </code></pre>