IE8 cashing problems

1044
8
Jump to solution
03-11-2014 08:53 AM
DarinaTchountcheva
Occasional Contributor II
I created a little test app, which creates programmatically some radion buttons and buttons, loads a tiled map + feature layer, and shows a legend. Nothing fancy.

All works fine in Chrome and Firefox.
In IE8 if the Browser History settings are set to "Automatically" to Check for newer versions of the stored pages, the pages load correctly only if I clear the cache. And they do not load correctly after that if I click the refresh browser button or Ctrl+F5. When I debug using the Developer Tools, on a refresh the modules don't load, and the function creating the buttons and the map don't execute.

If I change the Browser History settings to "Every time I visit the webpage", it works fine, and if I refresh the pages they load correctly.


Attached is my little test project. Hope, someone will have some time to let me know what I am doing wrong. Just learning the AMD loader now, so I might be messing up something.

If you have had the same problem and have found a solution, please, advice!

Thank  you!
0 Kudos
1 Solution

Accepted Solutions
MichaelVolz
Esteemed Contributor
Darina:

I ran the Search.htm app in IE with Fiddler2 running and I get a 502 error with ZipCode.  Even though the URL is for ESRI's mapservice, it looks like somewhere in your script(s) it is looking at myserver.  Can you double-check that there are no references to your specific server in any of the dependent scripts that were provided in your original zip file?

View solution in original post

0 Kudos
8 Replies
MichaelVolz
Esteemed Contributor
I copied the zipped files to a server that has IIS and placed it at c:\inetpub\wwwroot\Testjsapi and I called the URL:

"server name"/testjsapi/index.htm in FireFox

but I do not get any map.

Are the mapservices in this app publicly available?
0 Kudos
DarinaTchountcheva
Occasional Contributor II
Mike,

Thank you for looking into it.

The services are not public. And I just substituted the server name with "myserver".

Try using the ESRI services. I get the same behavior with them too. 

Tiled layer (basemap): http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer
Feature Layer (zipcodes): http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3

The map will draw slow though with these services, because my code does not filter the feature layer.

Thank you!
0 Kudos
MichaelVolz
Esteemed Contributor
I only see a reference to a mapservice in search.htm at mapApp.Init which I changed to:

mapApp.init({
                    basemapUrl: "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer",
                    mapContainerId: "map",
                    legendContainerId: "legend"
                });

but I still get no map to appear.

Is there somewhere else that I need to substitute ESRI's mapservice so I can see a map with your app?
0 Kudos
DarinaTchountcheva
Occasional Contributor II
Mike,

Map services are defined only in the search.htm:

[HTML]
<script type="text/javascript">

        require(["modules/start", "modules/app", "modules/search"],
            function (start, mapApp) {               
                start.init("search");

                mapApp.init({
                    basemapUrl: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",
                    zipcodesUrl: "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3",
                    mapContainerId: "map",
                    legendContainerId: "legend"
                });


            });

    </script>
[/HTML]


And one more thing. I was running this in Visual Studio web server, so the paths parameter in the dojoConfig was working. On a web server, please change the paths parameter in the dojoConfig with:


paths: { modules: location.pathname.replace(/\/[^/]+$/, "") +  "/js/modules" }


The index.htm uses no arcgis classes, but has the same caching problem: buttons don't get created in IE. So, I think, this more of a Dojo problem.

Thank  you!

Darina
0 Kudos
MichaelVolz
Esteemed Contributor
After making your changes, I still get no map to appear with either FireFox or IE.

Any idea what else I need to look at to get your app to work with ESRI services?
0 Kudos
DarinaTchountcheva
Occasional Contributor II
Mike,

I just copied the files that I attached to a web server (IIS 7), made the changes I told you, and for search.htm I get a bunch of buttons on the left, map in the center, and legend on right.

With index.htm, I get just some radio buttons and buttons, that do nothing for now.

Both work fine in Firefox, Chrome, and sometimes in IE8.

I am not sure why you don't get the map.

Darina
0 Kudos
MichaelVolz
Esteemed Contributor
Darina:

I ran the Search.htm app in IE with Fiddler2 running and I get a 502 error with ZipCode.  Even though the URL is for ESRI's mapservice, it looks like somewhere in your script(s) it is looking at myserver.  Can you double-check that there are no references to your specific server in any of the dependent scripts that were provided in your original zip file?
0 Kudos
DarinaTchountcheva
Occasional Contributor II
Mike,

I don't see any other references in the code to my server.

But i think I found the problem. I had an empty module in the define section of the start.js. I had the areaExtent added, but I had not put any code in there, and I haven't used it in the code. But I guess, it was messing IE. After I removed it from the list, the search.htm and index.htm started working as expected (both pages are using start.js).

define(
    [
        "dojo/_base/array",
        "dijit/registry",
        "dijit/form/Button",
        "dijit/form/RadioButton", 
        "modules/areaExtent"        
    ],
    function (arrayUtil, registry, Button, RadioButton, AreaExtent) 


When I was packing the code to attach it here I noticed it, and removed it from the file, so it is not in the attachment, and the attached code works fine in IE.

Thanks to you trying to make it work, I had to install the code that I packed and test it. This is when I noticed that this code works, but not the one I originally had. I started looking for the differences, and found it.

Thank you!

Darina
0 Kudos