- Home
- Categorie
- Coding e Sistemistica
- Coding
- larghezza finestra browser: problemi con internet explore
- 
							
							
							
							
							larghezza finestra browser: problemi con internet exploreCiao a tutti, ho bisogno di calcolare la larghezza della finestra del browser per posizionare i contenuti all'interno. Questa è la mia funzione 
 [PHP]if (!isset ($_GET['larghezza'])){
 echo '<script type="text/javascript">var myWidth = 0, myHeight = 0; 
 if( typeof( window.innerWidth ) == "number" ) {
 //Non-IE
 myWidth = window.innerWidth;
 myHeight = window.innerHeight;
 window.location = "index.php?larghezza="+myWidth+"&altezza="+myHeight;
 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
 //IE 6+ in "standards compliant mode"
 myWidth = document.documentElement.clientWidth;
 myHeight = document.documentElement.clientHeight;
 window.location = "index.php?larghezza="+myWidth+"&altezza="+myHeight;
 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
 //IE 4 compatible
 myWidth = document.body.clientWidth;
 myHeight = document.body.clientHeight;
 window.location = "index.php?larghezza="+myWidth+"&altezza="+myHeight;
 }window.location = "index.php?larghezza="+myWidth+"&altezza="+myHeight; </script> '; }[/PHP] il problema è che explorer non mi restituisce la variabile come tutti gli altri browser ma il valore è nullo... avete una soluzione ? 
 Grazie!