IE7 Cross-domain issue with TitlePane digit

701
4
11-30-2011 12:38 PM
by Anonymous User
Not applicable
Could someone explain to me why this first code example works in IE8 but but the second one doesn't.  I dont understand why I get the "Could not load cross-domain resources" error with the TitlePane digit but not other digits from esri.  It works right from dojo.

Thanks,
Ali

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr">
   
    <head>
        <style type="text/css">
            body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
        </style>
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js"
        djConfig="parseOnLoad: true">
        </script>
        <script type="text/javascript">
            dojo.require("dijit.TitlePane");
        </script>
        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css"
        />
    </head>
   
    <body class=" claro ">
        <div id="tp2" dojoType="dijit.TitlePane" title="I'm a TitlePane Too">
            Click arrow to close me.
        </div>       
    </body>

</html>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr">
   
    <head>
        <style type="text/css">
            body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
        </style>
        <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"
        djConfig="parseOnLoad: true">
        </script>
        <script type="text/javascript">
            dojo.require("dijit.TitlePane");
        </script>
        <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/claro/claro.css"
        />
    </head>
   
    <body class=" claro ">
        <div id="tp2" dojoType="dijit.TitlePane" title="I'm a TitlePane Too">
            Click arrow to close me.
        </div>       
    </body>

</html>
0 Kudos
4 Replies
KellyHutchins
Esri Frequent Contributor
You need to create the djConfig object before including the dojo core (comes with ArcGIS API for JavaScript). Here's a modified version of your code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr">

<head>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/claro/claro.css"
/>
<style type="text/css">
body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
</style>
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"></script>
<script type="text/javascript">
dojo.require("dijit.TitlePane");
</script>

</head>

<body class=" claro ">
<div id="tp2" dojoType="dijit.TitlePane" title="I'm a TitlePane Too">
Click arrow to close me.
</div> 
</body>

</html>

0 Kudos
by Anonymous User
Not applicable
I appreciate your help.  Unfortunately I still get the same cross-domain error with your modfied code in IE.  I get that the dojo core is part of the ArcGIS JavaScript API, so I don't understand why the ArcGIS version of the dojo core has this issue when the native dojo reference works fine.
0 Kudos
KellyHutchins
Esri Frequent Contributor
In my testing it works fine with both in IE. I do not get cross domain errors. Here's a running test case:

http://jsfiddle.net/4gLJR/
0 Kudos
by Anonymous User
Not applicable
Thanks again.  It seems to be working in IE7, but now I'm really confused.  Initially your test case still didn't work for me in IE 8.0.6.  I then clicked on the compatibility button and it now works even if I turn the compatibility mode off.  Thanks for your help getting it working.
0 Kudos