javascript - Catching Mixed content error -


i'm trying detect xhr failing on mixed content. looks different browsers have different implementations:

var xhr = new xmlhttprequest(); try {   xhr.open('http://otherdomain/'); } catch (err) {   console.log(err); // ie10 hits 1 } try {   xhr.send(); // chrome fails here, doesn't throw error } catch (err) {   console.log(err); // no browser i've tried hits 1 } 

i don't want use autodetection (xhr.open('//otherdomain')), since target might not support http, or https. want know call failed, can show error in page. possible handle correctly browsers?

there no way handle error javascript unfortunately. security restriction enforced browser , thrown on lower level. have tried many different methods, including use of extensions nothing worked except timeout handler honest.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -