恼人的javascript错误 [英] annoying javascript error
问题描述
大家好我是javascript的新手,我正试图在
JS / PHP中编写一个网站来跳转ajax乐队旅行车。我收到以下
错误,但尚未找到解决方案。从
我读到的一些人说它可能与xmlrequest有关
正在忙碌或类似的东西。
错误:[例外...组件返回失败代码:0xc1f30001
(NS_ERROR_NOT_INITIALIZED)[nsIXMLHttpRequest.send]" nsresult:
" 0xc1f30001(NS_ERROR_NOT_INITIALIZED)" location:JS frame :: mysite
:: getImage :: line 37"数据:没有]
源文件:mysite
行:37
谢谢!
Hello all I am new to javascript and I am attempting to write a site in
JS / PHP to jump on the ajax band wagon. I am getting the following
error and have not been able to locate a solution for it yet. From
what I have read some people say it could have to do with xmlrequest
being busy or something like that.
Error: [Exception... "Component returned failure code: 0xc1f30001
(NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: mysite
:: getImage :: line 37" data: no]
Source File: mysite
Line: 37
thanks!
推荐答案
seanism在5/14/2006 2:04 PM发表以下内容:
seanism said the following on 5/14/2006 2:04 PM:
大家好我是javascript的新手,我正在尝试在JS / PHP中写一个网站来跳上ajax乐队的旅行车。
哦,geez,另一个。
我收到以下错误,但尚无法找到它的解决方案。从我所读到的一些人说它可能与xmlrequest繁忙或类似的东西有关。
或者另外一百万个SWAG可以做的。
错误:[异常...]组件返回失败代码:0xc1f30001
(NS_ERROR_NOT_INITIALIZED)[nsIXMLHttpRequest.send]" nsresult:
" 0xc1f30001(NS_ERROR_NOT_INITIALIZED)" location:JS frame :: mysite
:: getImage :: line 37数据:没有]
源文件:mysite
行:37
Hello all I am new to javascript and I am attempting to write a site in
JS / PHP to jump on the ajax band wagon.
Oh geez, another one.
I am getting the following error and have not been able to locate a
solution for it yet. From what I have read some people say it could
have to do with xmlrequest being busy or something like that.
Or one of another million SWAG''s one could make.
Error: [Exception... "Component returned failure code: 0xc1f30001
(NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: mysite
:: getImage :: line 37" data: no]
Source File: mysite
Line: 37
我的立体声无法正常工作。为什么?
重点是,你无法确定代码是什么,你不能看到它们。
-
兰迪
comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周
Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /
My stereo doesn''t work. Why?
The point being, you can''t determine whats wrong with code that you
can''t see.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
确实非常真实。
< script type =" text / javascript" ;>
<! -
var results;
function vote(user_id,v){
//构建要连接的URL
var url =" vote_ajax.php?id =" + results [0] +"& user_id =" + user_id +
"& vote =" + v;
request.abort();
//打开与服务器的连接
request.open(" GET", url,true);
//设置服务器完成后运行的功能
request.onreadystatechange = window.location.reload (true);
//发送请求
request.send(null);
}
函数getImage(){
//构建要连接的URL
var url =" image_ajax.php" ;;
//打开与服务器的连接
request.open(" GET",url,true);
//设置a服务器完成后运行的功能
request.onreadystatechange = changeImage;
//发送请求
request.send(null);
}
函数changeImage(){
if(request.readyState == 4 ){
//将逗号分隔的响应拆分为数组
results = request.responseText.s plit(",");
document.getElementById(''image'')。innerHTML = results [2];
}
}
// - >
< / script>
very true indeed.
<script type="text/javascript">
<!--
var results;
function vote(user_id, v){
// Build the URL to connect to
var url = "vote_ajax.php?id=" + results[0] + "&user_id="+ user_id +
"&vote=" + v;
request.abort();
// Open a connection to the server
request.open("GET", url, true);
// Setup a function for the server to run when it''s done
request.onreadystatechange = window.location.reload( true );
// Send the request
request.send(null);
}
function getImage(){
// Build the URL to connect to
var url = "image_ajax.php";
// Open a connection to the server
request.open("GET", url, true);
// Setup a function for the server to run when it''s done
request.onreadystatechange = changeImage;
// Send the request
request.send(null);
}
function changeImage(){
if (request.readyState == 4) {
// Split the comma delimited response into an array
results = request.responseText.split(",");
document.getElementById(''image'').innerHTML = results[2];
}
}
//-->
</script>
var request = false;
尝试{
// Mozilla / Safari
if(window.XMLHttpRequest)
request = new XMLHttpRequest();
// IE
else if(window.ActiveXObject)
request = new ActiveXObject(" ; Microsoft.XMLHTTP");
}
catch(e){
alert(e);
}
//错误
如果(!请求)
alert(XHR对象无法创建);
var request = false;
try{
// Mozilla/Safari
if (window.XMLHttpRequest)
request = new XMLHttpRequest();
// IE
else if (window.ActiveXObject)
request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert(e);
}
// Error
if(!request)
alert("XHR Object cannot create");
这篇关于恼人的javascript错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!