1

I have created a deepzoom image, and when image files is placed locally I can display it with this code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
    <style type="text/css">
        body {
            margin: 0px;
            font-family: Verdana;
            line-height: 1.25em;
        background-color:#000000; 
        }

    </style>

    <script type="text/javascript" src="http://seadragon.com/ajax/0.8/seadragon-min.js"></script>
    <script type="text/javascript">
        var viewer;

        function init() {
            viewer = new Seadragon.Viewer("container");
            viewer.openDzi("spider.xml");
        viewer.setFullPage(true);
        }

        Seadragon.Utils.addEvent(window, "load", init);
    </script>
</head>

<body>
<div id="content">

    <div id="container">
    </div>


</div>
</body>

</html>

But when I then uploaded the images and the xml file to http://foto.qaz.dk

and changed the following code viewer.openDzi("spider.xml"); to viewer.openDzi("http://foto.qaz.dk/spider.xml");

I get an error message from seadragon "Hmm, this doesnt appear to a valied deep zoom image"

What am I doing wrong?

CruelIO
  • 18,196
  • 16
  • 40
  • 58

2 Answers2

1

See this post:

http://dragonosticism.wordpress.com/2008/11/25/seadragon-ajax-and-cross-site-scripting/

You have hit a cross-scripting javascript problem thingy. You will need to move your script onto the remote host or think again.

ʍǝɥʇɐɯ
  • 4,012
  • 7
  • 32
  • 53
0

do you control foto.qaz.dk ? if so, set the appropriate CORS headers, download the XML as a string and pass said string to you openDzi call as the second parameter. For more on CORS : http://en.wikipedia.org/wiki/Cross-origin_resource_sharing

CORS is not supported in older browsers, but since you are writing a seadragon based app, assumption is you have an expectation of only working with modern browsers. see: http://caniuse.com/#feat=cors

Paul Allen
  • 349
  • 1
  • 9