troubleshooting Question

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

Avatar of jbadia
jbadia asked on
PHPJavaScriptWeb 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');;
  ajax=objetoAjax();"POST", "actu_Carrito.php",true);
  ajax.onreadystatechange=function() {
  if (ajax.readyState==4) {
  divResultado.innerHTML = ajax.responseText

In this page you can see my web application:

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.


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 6 Comments.
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>


Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 6 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004