Jump to content

compability with IE


patchido
 Share

Recommended Posts

Hi, i am pretty new to javascript, and i don't know why IE won't show as excpected since the functions i am using appear to be compatible with the browser, basically what isn't working is a canvas that is being drawn with javascript. here is my code, i hope someone can help me a bit. ( it works on chrome). here is my code.

<!DOCTYPE html><html><head>  <title>Paqueteria Qualtia</title>		<input type="hidden" id="id_log" value="2"></input>  <link href="stylesheets/public.css" media="all" rel="stylesheet" type="text/css" />		<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>	  	  	         <script type="text/javascript">   $(document).ready(function(){  	$('canvas').each(function(){	 if(this.getContext){	  var context = this.getContext('2d');	  var arrayColor = ["Red","Red","Red","Red","Red","Red","Red"];	  //alert($(this).attr('class'));	  for(var i=0;i<=$(this).attr('class');i++){	   arrayColor[i]="Green";	   if(i<6) arrayColor[i+1]="Orange";	  }		  var array1 = ["Registro","Cluster Asignado","Salida de embarques","Transito","Llegada de embarques","Paquete en cedis","Recibido"];	  for(var i=0;i<7;i++){	   context.fillStyle = arrayColor[i];	   context.beginPath();	  	   context.arc(20+i*80, 5, 5, 0, 2*Math.PI);	   context.closePath();	   context.fill();	  	  }	  for(var i=0;i<7;i++){	   var txt = array1[i];	   context.beginPath();	   context.fillStyle = arrayColor[i];	   context.font="11px Arial";	   var y = 0;	   if(i%2==0){y=31} else{y=20};	   context.fillText(txt,20+i*80-context.measureText(txt).width/2,y);	  	  }	  for(var i=0;i<6;i++){	   context.strokeStyle = arrayColor[i+1];	   context.beginPath();	  	   context.moveTo(25+i*80,5);	   context.lineTo(100+i*80-5,5);	   context.stroke();	  	  }					 }	});   });   </script>			  </head><body> <div class="colmask leftmenu"><div class="colleft">        <div class="col1">		  		  		  			<br /><label class="send">Enviados</label><br  />					  			<table class="send"><tr><th><p>Nombre</p></th><th><p>Apellido</p></th><th><p>Correo</p></th><th><p>Guia</p></th><th><p>Estatus</p></th></th><tr><td><p>GUILLERMO</p></td><td><p>BUELNA</p></td><td><p>gbuelna@qualtia.com</p></td><td><p>6</p></td><td><canvas class="2" width="540" height="35"></canvas></td></tr><tr><td><p>PAULA MERCEDES</p></td><td><p>DODDOLI</p></td><td><p>pdoddoli@qualtia.com</p></td><td><p>7</p></td><td><canvas class="6" width="540" height="35"></canvas></td></tr><tr><td><p>JORGE LUIS</p></td><td><p>BOJORQUEZ</p></td><td><p>jbojor@qualtia.com</p></td><td><p>8</p></td><td><canvas class="2" width="540" height="35"></canvas></td></tr><tr><td><p>MARCELA</p></td><td><p>ANDRADE</p></td><td><p>mandrade@dominio.qualtia.com</p></td><td><p>9</p></td><td><canvas class="2" width="540" height="35"></canvas></td></tr><tr><td><p>SAMANTHA AURELV</p></td><td><p>DURAN</p></td><td><p>sduran@qualtia.com</p></td><td><p>10</p></td><td><canvas class="2" width="540" height="35"></canvas></td></tr><tr><td><p>AARON HUMBERTO</p></td><td><p>GARCIA</p></td><td><p>aumberto@qualtia.com</p></td><td><p>12</p></td><td><canvas class="2" width="540" height="35"></canvas></td></tr><tr><td><p>SIRAHUEN ARTURO</p></td><td><p>BALTAZAR</p></td><td><p>sbaltaza@qualtia.com</p></td><td><p>13</p></td><td><canvas class="6" width="540" height="35"></canvas></td></tr><tr><td><p>ABRAHAM</p></td><td><p>ANGUIANO</p></td><td><p>aanguian@dominio.qualtia.com</p></td><td><p>15</p></td><td><canvas class="6" width="540" height="35"></canvas></td></tr></table>		  		  			<br /><label class="recieve">Recibir</label><br  />		  			<table class="recieve"><tr><th><p>Nombre</p></th><th><p>Apellido</p></th><th><p>Correo</p></th><th><p>Guia</p></th><th><p>Estatus</p></th></th></table>		  		</div>          <div class="col2">			<h1>Menu</h1>	<ul class="subjects">					<li><a href="registro.php">Registrar Envio</a></li><li><a href="guias.php">Checar Guias</a></li><li><a href="perfil.php">Editar Perfil</a></li><li><a href="cedis.php">Cedis</a></li><li><a href="embarques.php">Embarques</a></li><li><a href="usuarios.php">Gestion Usuarios</a></li><li><a href="logout.php">Salir</a></li>			  </ul>		  </div> </div></div>      	  </body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...