troubleshooting Question

ajax problem in explorer 7, but not in firefox, inserting records

Avatar of jbadia
jbadia asked on
JavaScriptPHPWeb Applications
6 Comments1 Solution735 ViewsLast Modified:
Hello, I have spent 4 days on my problem:

I have an online add TO Basket page where I see some products in php and MySql database.
Now I've implemented Ajax.
I have an ajax and javascript code that when I submit a product form, inserts a product in my basket (on the right of page.
It works fine in Firefox but not in explorer, and I answer to know WHY???

this is my ajax code:

function objetoAjax(){
      var xmlhttp=false;
      try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
            try {
               xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                  xmlhttp = false;
              }
      }
      if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
            xmlhttp = new XMLHttpRequest();
      }
      return xmlhttp;
}
function enviarDatosEmpleado(){
  divResultado = document.getElementById('resultado');
      id=document.frmempleado.id.value;
      color=document.frmempleado.color.value;
      talla=document.frmempleado.talla.value;
      cantidad=document.frmempleado.cantidad.value;
      marca=document.frmempleado.marca.value;
      artId=document.frmempleado.artId.value;
      pid=document.frmempleado.id.value;
  ajax=objetoAjax();
  ajax.open("POST", "actu_Carrito.php",true);
  ajax.onreadystatechange=function() {
  if (ajax.readyState==4) {
  divResultado.innerHTML = ajax.responseText
  }
  }
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send("id="+id+"&color="+color+"&talla="+talla+"&cantidad="+cantidad+"pid="+pid+"marca="+marca+"artId="+artId)
}

In this page you can see my web application:

http://www.merc-barcelona.com/proves/mig.php?start=0&marca=27&artId=15&pid=486

When a submit the form I call the function 'enviarDatosEmpleado()' that inserts a cell in a mysql table and show again the basket.

I have this code into a page included into a php.

I  can post the rest of the code for anyone who need it.

Thnks a lot.

Jordi
Barcelona
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros