I've got drupal installed in one domain and gallery2 in a subdomain (running on two different machines). I've previously used this code to get a "lightbox" effect using thickbox:
<a href="http://a.b.com/bp/2007/04/2007-04-14.jpg" alt="" class="thickbox" title=""><img src="http://a.b.com/bp/ 2007/04/2007-04-14_s.jpg" alt="" style="float:left; padding: 5px"/></a>
(the drupal site has the address www.b.com)
So when I clicked on the thumbnail thichbox have shown the larger image as expected. However, I've installed Gallery 2 a few months back and now I want to get thumbnail and original from Gallery instead of having the picts outside Gallery, so I tried something like this:
<a href="http://a.b.com/galbum/main.php?g2_view=core.DownloadItem&g2_itemId=1480" alt="" class="thickbox" title=""><img src="a.b.com/galbum/main.php?g2_view=core.DownloadItem&g2_itemId=1482" alt="" /></a>
When I save and click on the picture using Firefox I get an error dialog:
The page at http://www.b.com says:
Permission denied to call method XMLHttpRequest.openBut I don't understand why I get this error, could anyone explain?
Comments
Comment #1
kleingeist commentedthis is probably a problem due to the core thicbox.js distinction between images and "iframe-ajax-content". LInks with special filextensions (.jpg, .png,,,) will be shown as image boxes. Everything else will be treated as another html page and thus will be loaded thourgh the xml request into an iframe-box.
So, just change the line 50 and 52 in thicbox,js to fit to the url structure to your pictures. i guess something like "core.DownloadItem" could act as keword. See also this issue http://drupal.org/node/140371 by jghide which explains exactly this problem.
The actual Erros message seems to me like an ff error. Maybe it wont allow xmlhttprequests through different pages. But its definately no primary thickbox module error.
Comment #2
skromta commentedThanks, I took a quick look at the javascript code but since I know nothing about javascript I couldn't understand if it was possible to use a regular expression to define what to look for. But it turns out that Gallery have a URL rewrite option that makes it work without any changes in thickbox ... so now it works. Thanks for putting me on the right track.
Comment #3
frjo commented