2012-09-18 70 views
1

在这里有一些问题。 似乎只在IE 8(或7)中失败。 如果你帮我,我会很高兴。JavaScript函数调用在IE中不工作

$.ajax({type: "POST", 
    url:"update_data.php", 
    data: { 
      table:table, 
      key:key, 
      obj_name:"New Element"         
      }, 
      success: function(data){ 
      $('.ajax').html($('.ajax input').val()); 
      $('.ajax').removeClass('ajax'); 
      $.get("get_process.php", { 
        func: "software", 
        selected: "All_Software" 
      }, function(response){ 
       $('#result_software').fadeOut(); 
       setTimeout("finishAjax_software('result_software', '"+escape(response)+"')", 400); 
         }) 
       return false; 
          } 
        });updateSelect('software'); 

这里updateSelect的代码:

function updateSelect(id){ 
      $('#'+id).html(''); 
      $.get("get_process.php", { 
        options: id, 
       }, 
       function(response){ 
        $('#'+id).fadeOut(); 
        setTimeout("finishAjax_"+id+"('"+id+"', '"+escape(response)+"')", 1000); 
      })  
     } 

所以updateSelect调用不会在IE 8的工作有所帮助我,请

+0

看起来不错对我来说,它可能是额外的(但合法的)尾随逗号在行*选项:编号,* –

+0

谢谢,你是对的!我的代码行hundret后,我似乎是盲目的:) – x4k3p

回答

2

尝试用:

function updateSelect(id){ 
     $('#'+id).html(''); 
     $.get("get_process.php", { 
       options: id  // <-- remove trailing comma 
      }, 
      function(response){ 
       $('#'+id).fadeOut(); 
       setTimeout("finishAjax_"+id+"('"+id+"', '"+escape(response)+"')", 1000); 
      } 
     )  
    } 
+0

好男人!谢谢 – x4k3p