javascript - Firefox 23 and IE10 no longer playing nice with my XMLHttpRequest, I have CORS in php -


i have bit of java script grabbing id off website , passing php script on seperate domain:

javascript on:

https://myspot.com

and going to

http://theotherwebsite.edu

this more or less working, had work previous cross site solution seems not honored on firefox 23 , ie10.

the previous solution using this:

 var isie10 = false; //this beacuse stupid ie10 not work window.xdomainrequest  /*@cc_on      if (/^10/.test(@_jscript_version)) {          isie10 = true;      }  @*/  console.log(isie10);  var isie8 = window.xdomainrequest ? true : false;    var invocation=createcrossdomainrequest();  function createcrossdomainrequest(url, handler) {         var request;         if ((isie8) && (!isie10)) //tried hack own isie10 fix didnt work         {             request = new window.xdomainrequest();         }         else         {             request = new xmlhttprequest();         }         return request;  }   function callotherdomain()     {         if (invocation)         {             if("withcredentials" in invocation) //was taking stab in dark this.             {                 invocation.onload=outputresult;                 invocation.open("get", url, true);                 invocation.send();              }              else if(isie8)             {                 invocation.onload = outputresult;                 invocation.open("get", url, true);                 invocation.send();             }             else             {                 invocation.open('get', url, true);                 invocation.onreadystatechange = handler;                 invocation.send();             }         }         else         {             var text = "no invocation tookplace @ all";             var textnode = document.createtextnode(text);             var textdiv = document.getelementbyid("textdiv");             textdiv.appendchild(textnode);         }     } function handler(evtxhr)     {         if (invocation.readystate == 4)         {             if (invocation.status == 200)             {                 outputresult();                              }             else             {                 alert("invocation errors occured " + invocation.status + " state: " + invocation.readystate);             }         }     }      function outputresult()     {           var response = invocation.responsetext;                       //get json of response         var obj = json.parse(response);         var mtype = obj.messagetype;         var output = obj.message;         var url = obj.url;                    if(mtype=="error")         {                            parent.location=url;         }         else if(mtype=="warning")         {             var answer=confirm(output);             if(answer)                 parent.location=url;          }           //var textdiv = document.getelementbyid("textdiv");         //textdiv.innerhtml += response;      }        

callotherdomain(); not sure going on here, on firefox 23 error in console:

blocked loading mixed active content "http://theotherwebsite.edu"

i know because main script loaded on https, vs http. not caring before. aware of error puts shield in address bar of firefox user can tell enable blocked content. not acceptable solution me. if put silly little php script under https, certificate need too?

then ie10 doesn't work:

script5: access denied. landing, line 64 character 421

so not sure need code working again, having user adjust browser isn't feasible cause distributed enterprise wide, nag screen let them know change password based on ldap entry php file accesses id passed website via ajax.

i doing googling found nothing, found php handle make website guess cors compatible:

<?php  header('access-control-allow-origin: *'); 

which implemented well. not sure try or next? simple json string comes back, can try preflight method described here:

http://ppe.blogs.msdn.com/b/ie/archive/2012/02/09/cors-for-xhr-in-ie10.aspx

??? if not sure headers should like.

i going post firefox 23 response header never makes request straight blocks loading mixed active content. guess have 2 issues contend with, 1 javascript lives on https , makes call http...this might issue in firefox, not 100% sure if have cross site issues.

ie10 network request header never find , looking inside f12 key pressed area in ie10, under network , click start capturing before load page xhr call.

so guess asking changed in firefox23 , ie10 not let code work anymore?

firefox 23+ block call "active mixed content". is: content hosted @ non-secure (http) location requested secure webpage (https). "active" in context means not media type (not image, audio or video resource). prevent man-in-the-middle attacks use non-secure sub-requests secure pages.

for more information see mixed content article on mdn.

as request blocked before hitting network, there won't response headers/data.

not sure ie10, their documentation seems indicate block such requests same reasons, saying:

cross-domain, cross-port, , mixed protocol requests not allowed.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -