注册 登录
编程论坛 jQuery论坛

关于AJAX兼容问题。。。

hacowz 发布于 2008-03-04 16:23, 1754 次点击
RT,在用AJAX编写一些页面的时候,如提交页面,往往在IE下点提交无反应,在FIRFOX下却能顺利提交,这是为什么呢?难道是prototype兼容问题?
2 回复
#2
lmhllr2008-03-04 17:11
prototype能很好的兼容多种浏览器

应该是自己代码的问题...帖出来看看.....
#3
hacowz2008-03-04 17:21
</tr>
                        </table></td>
                  </tr>
                    <tr>
                        <td height="30">&nbsp;</td>
                        <td width="161" align="left">&nbsp;</td>
                        <td width="237" align="left"><input class="btn_org" type="button" name="create_btn" id="btn_id" value="提   报" onclick="javascript:submit_form();" /></td>
                        <td width="13">&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    
                </table>



function submit_form()
{
    $('query_form').request({
      method: 'get',
      parameters: {action:'load_data'},
      onLoading  : loading_data,
      onComplete: function(transport)
      {  
          if (200 == transport.status)
        {
            alert(transport.responseText);
            $('listingpaginate').style.display="block";
            document.getElementById('waiting_data').style.display="none";
            document.getElementById('btn_id').disabled=false;
            out_put = transport.responseText;
            get_arr = out_put.split("$");
            if (get_arr[0]=="success_1")
            {
                $('listingpaginate').innerHTML="<font color='red'>提报成功,请及时定位激活该店!</font>";
                for(i=0;i<100;i++)
                {  
                    document.add_shop_msg_form.elements[i].value="";
                }
                document.getElementById('btn_id').value="提    报";
                document.getElementById('RelShopID').selectedIndex=0;
                document.getElementById('shop_pro_id').selectedIndex=0;
                document.getElementById('shop_place_id').selectedIndex=0;
            }
            else if (get_arr[0]=="success_2")
            {
                $('listingpaginate').innerHTML="<font color='red'>提报成功,该店已激活!</font>";
                for(i=0;i<100;i++){  
                    document.add_shop_msg_form.elements[i].value="";
                }
                document.getElementById('btn_id').value="提    报";
                document.getElementById('RelShopID').selectedIndex=0;
                document.getElementById('shop_pro_id').selectedIndex=0;
                document.getElementById('shop_place_id').selectedIndex=0;
            }
            else
            { // document.getElementById("RelShopID").innerHTML =  get_arr[1];
                $('listingpaginate').innerHTML=transport.responseText;
            }
            
            
            
        }
      }
    });
}
这个是 JS代码,改良后的,能运行
1