Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9 fails to show page content #167

Open
tmfrnz opened this issue Apr 18, 2017 · 3 comments
Open

IE9 fails to show page content #167

tmfrnz opened this issue Apr 18, 2017 · 3 comments
Labels

Comments

@tmfrnz
Copy link
Collaborator

tmfrnz commented Apr 18, 2017

On Internet Explorer 9 page content not loading on development site from NIWA CMS caused by CORS (cross-origin resource sharing) restrictions

On localhost content pages load but prompting a warning message (see https://blogs.msdn.microsoft.com/ieinternals/2011/04/21/a-security-prompt-that-makes-you-go-huh/)
4405 image_3d4b2e39

@tmfrnz
Copy link
Collaborator Author

tmfrnz commented Apr 18, 2017

@craigstanton @robbinsje a few questions

  • have you come across this issue before when using the XML API of your CMS?
  • will the production site be a NIWA subdomain (eg ptdb.niwa.co.nz)? this may resolve it

Here is the ajax call and setup I am using btw

$.support.cors = true;
        $.ajax({
          crossDomain: true,
          dataType:this.getFormat(),
          url:this.getUrl(),
          success:function(content) {

            switch (that.getFormat()) {                    
              case "xml":
                var content = $.xml2json(content)
                // according to NIWA's content XML structure
                if (typeof content["#document"] !== "undefined") {
                  if (content["#document"]["result"]["nodes"] !== "") {
                    content = content["#document"]["result"]["nodes"]["item"]["body"]["und"]["item"]["safe_value"]
                  } else {
                    content = "<p>ERROR LOADING RESOURCE: requested resource does not exist</p>"
                  }
                }
                callback(content)
                break
              default:
                callback(content)
                break                
            }
          },
          error: function(){
            console.log("error loading content")
          }

https://github.com/dumparkltd/tsunami-db/blob/master/app/models/ContentModel.js#L19

@robbinsje
Copy link
Contributor

We have not come across this I suspect partly because we no longer strive to make anything work in Internet Explorer 9.
This is only a warning, of something that is true, so I am inclined to not worry about it.

@tmfrnz
Copy link
Collaborator Author

tmfrnz commented Apr 19, 2017

Unfortunately the warning appears only when serving the site locally http://localhost:8000 but on the development site hosted on GitHub pages it will just fail to load altogether.

Regardless, given that IE 9 is not a priority and if you are planning to host it as a NIWA subdomain, we should just wait for the launch.

@tmfrnz tmfrnz added the bug label May 6, 2017
@tmfrnz tmfrnz modified the milestone: Final release May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants