Note that there are some explanatory texts on larger screens.

plurals
  1. POXmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin
    text
    copied!<p>I'm developing a page that pulls images from Flickr and Panoramio via jQuery's AJAX support.</p> <p>The Flickr side is working fine, but when I try to <code>$.get(url, callback)</code> from Panoramio, I see an error in Chrome's console:</p> <blockquote> <p>XMLHttpRequest cannot load <a href="http://www.panoramio.com/wapi/data/get_photos?v=1&amp;key=dummykey&amp;tag=test&amp;offset=0&amp;length=20&amp;callback=processImages&amp;minx=-30&amp;miny=0&amp;maxx=0&amp;maxy=150" rel="noreferrer">http://www.panoramio.com/wapi/data/get_photos?v=1&amp;key=dummykey&amp;tag=test&amp;offset=0&amp;length=20&amp;callback=processImages&amp;minx=-30&amp;miny=0&amp;maxx=0&amp;maxy=150</a>. Origin null is not allowed by Access-Control-Allow-Origin.</p> </blockquote> <p>If I query that URL from a browser directly it works fine. What is going on, and can I get around this? Am I composing my query incorrectly, or is this something that Panoramio does to hinder what I'm trying to do?</p> <p>Google didn't turn up any useful matches on the <a href="http://www.google.co.uk/search?q=%22Origin+null+is+not+allowed+by+Access-Control-Allow-Origin%22" rel="noreferrer">error message</a>.</p> <p><strong>EDIT</strong></p> <p>Here's some sample code that shows the problem:</p> <pre><code>$().ready(function () { var url = 'http://www.panoramio.com/wapi/data/get_photos?v=1&amp;key=dummykey&amp;tag=test&amp;offset=0&amp;length=20&amp;callback=processImages&amp;minx=-30&amp;miny=0&amp;maxx=0&amp;maxy=150'; $.get(url, function (jsonp) { var processImages = function (data) { alert('ok'); }; eval(jsonp); }); }); </code></pre> <p>You can <a href="http://jsfiddle.net/ZfvKm/" rel="noreferrer">run the example online</a>.</p> <p><strong>EDIT 2</strong></p> <p>Thanks to Darin for his help with this. <strong>THE ABOVE CODE IS WRONG.</strong> Use this instead:</p> <pre><code>$().ready(function () { var url = 'http://www.panoramio.com/wapi/data/get_photos?v=1&amp;key=dummykey&amp;tag=test&amp;offset=0&amp;length=20&amp;minx=-30&amp;miny=0&amp;maxx=0&amp;maxy=150&amp;callback=?'; $.get(url, function (data) { // can use 'data' in here... }); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload