xmlhttprequest无法使用mozilla firefox 38.0.1

时间:2015-06-02 11:48:51

标签: javascript firefox xmlhttprequest

我的代码(如下)正在使用Internet Explorer 8.0及更高版本,但不适用于Mozilla Firefox 38.0.1。我该如何解决这个问题?

我收到以下错误:

  
      
  • NS_ERROR_DOM_BAD_URI:拒绝访问受限制的URI

  •   
  • 表单以windows-1252编码提交,无法对所有Unicode字符进行编码,因此用户输入可能会损坏。为避免此问题,应更改页面以便以UTF-8编码提交表单...

  •   
function abc(idx, url)
{
    if (window.XMLHttpRequest)    
    { 
      xmlhttp=new XMLHttpRequest();    
    }
    else    
    {    
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");    
    }

    xmlhttp.onreadystatechange=function()    
    {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)    
      {
        document.forms["archive"+idx].method = "POST";    
        document.forms["archive"+idx].submit();    
      }
  }

  xmlhttp.open("GET",url,true,"serviceid","password");
  xmlhttp.send(null);
}

0 个答案:

没有答案