473,698 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

annoying javascript error

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_I NITIALIZED) [nsIXMLHttpReque st.send]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_I NITIALIZED)" location: "JS frame :: mysite
:: getImage :: line 37" data: no]
Source File: mysite
Line: 37

thanks!

May 14 '06 #1
10 4616
seanism said the following on 5/14/2006 2:04 PM:
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_I NITIALIZED) [nsIXMLHttpReque st.send]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_I NITIALIZED)" location: "JS frame :: mysite
:: getImage :: line 37" data: no]
Source File: mysite
Line: 37


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.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 14 '06 #2
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("G ET", url, true);

// Setup a function for the server to run when it's done
request.onready statechange = window.location .reload( true );

// Send the request
request.send(nu ll);
}

function getImage(){
// Build the URL to connect to
var url = "image_ajax.php ";
// Open a connection to the server
request.open("G ET", url, true);

// Setup a function for the server to run when it's done
request.onready statechange = changeImage;

// Send the request
request.send(nu ll);
}

function changeImage(){
if (request.readyS tate == 4) {
// Split the comma delimited response into an array
results = request.respons eText.split("," );
document.getEle mentById('image ').innerHTML = results[2];
}

}
//-->
</script>

May 15 '06 #3
var request = false;
try{
// Mozilla/Safari
if (window.XMLHttp Request)
request = new XMLHttpRequest( );
// IE
else if (window.ActiveX Object)
request = new ActiveXObject(" Microsoft.XMLHT TP");
}
catch (e) {
alert(e);
}
// Error

if(!request)
alert("XHR Object cannot create");

May 15 '06 #4
seanism said the following on 5/14/2006 8:50 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

<URL: http://www.safalra.com/special/googlegroupsreply/ >
very true indeed.


Post a URL to a full sample page that displays the behavior and what
steps produce the error.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 15 '06 #5
rgr that Randy. Should I reply on the top or bottom of the quoted
information? Also is there an easy way to see what threads you
started? If I goto my profile it shows some on the bottom but I was
thinking that they would make it easier then that? I starred the
articles that I started to see them on the my posts link.

as far as the site its www.stoneorbone.com right now it works because
instead of calling the getImage function I just have it do a JS refresh
of the page.

Randy Webb wrote:
seanism said the following on 5/14/2006 8:50 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

<URL: http://www.safalra.com/special/googlegroupsreply/ >
very true indeed.


Post a URL to a full sample page that displays the behavior and what
steps produce the error.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


May 16 '06 #6
seanism said the following on 5/16/2006 2:10 PM:
rgr that Randy. Should I reply on the top or bottom of the quoted
information?
What do most in this group do and what does that FAQ/Notes say with
regards to that?

Hint: Pay attention to how my reply is done.
Also is there an easy way to see what threads you started?
For me, yes. But, I don't use Google Groups. Ask a Google Groups person.
If I goto my profile it shows some on the bottom but I was
thinking that they would make it easier then that? I starred the
articles that I started to see them on the my posts link.
<shrug> No idea as I don't use Google Groups.
as far as the site its www.stoneorbone.com right now it works because
instead of calling the getImage function I just have it do a JS refresh
of the page.


Well, you know the getImage() function works properly or you would get
errors when it gets triggered onload.

All of that code looks like a hard way to do something. What exactly is
it that you are trying to do with it? Let someone vote, post the vote,
then retrieve an image? But then you split that image and only use part
of it. Why not just have the PHP return the plain HTML code you want to use?

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 16 '06 #7
seanism wrote:
var request = false;
`request' is used as an object reference. It should be initialized
with `null' (null reference), not the boolean value `false'.
try{
There is no need for try...catch for XMLHttpRequest, only for ActiveXObject.
In fact, using too much exception handling can prevent you from catching
your bugs.
// Mozilla/Safari
if (window.XMLHttp Request)
You are feature-testing the mere _existence_ (to be more exact: the
_true-value_) of a property of _`window'_ ...
request = new XMLHttpRequest( );
.... but you _construct_ with a _method_ of the _Global Object_.
Furthermore, you do not declare `request', and so it becomes a property of
the Global Object, /iff/ there is no other object in the scope chain where
this applies to. Both approaches are error-prone.
// IE
else if (window.ActiveX Object)
request = new ActiveXObject(" Microsoft.XMLHT TP");
Same here.
}
catch (e) {
alert(e);
}
Your code style allows for improvement. For example, do not use tabs;
use spaces.
// Error

if(!request)
alert("XHR Object cannot create");


The content of those message boxes is useless to Joe User, so you better
make them debug messages only.

var _global = this;

function isMethod(a)
{
return a && /\b(function|obj ect)\b/.test(typeof a);
}

function getImage()
{
var request = null;

if (isMethod(_glob al.XMLHttpReque st))
{
request = new XMLHttpRequest( );
}
else if (isMethod(_glob al.ActiveXObjec t))
{
try
{
request = new ActiveXObject(" Microsoft.XMLHT TP");
}
catch (e)
{
// ...
}
}

if (request)
{
// ...
}
else
{
// ...
}

return request;
}
PointedEars
--
This above all: To thine own self be true.
-- William Shakespeare (1564-1616)
May 22 '06 #8
seanism wrote:
Error: [Exception... "Component returned failure code: 0xc1f30001
(NS_ERROR_NOT_I NITIALIZED) [nsIXMLHttpReque st.send]" nsresult:
"0xc1f30001 (NS_ERROR_NOT_I NITIALIZED)" location: "JS frame :: mysite
:: getImage :: line 37" data: no]
Source File: mysite
Line: 37


First Google hit for this error code:

<URL:http://www.quirksmode. org/blog/archives/2005/09/xmlhttp_notes_a _1.html>
PointedEars
May 22 '06 #9
Thomas 'PointedEars' Lahn said the following on 5/22/2006 11:26 AM:
seanism wrote:
var request = false;
`request' is used as an object reference. It should be initialized
with `null' (null reference), not the boolean value `false'.


Either one satisfies the requirements of the test that is used on it.
try{


There is no need for try...catch for XMLHttpRequest, only for ActiveXObject.
In fact, using too much exception handling can prevent you from catching
your bugs.


Absolutely.
// Mozilla/Safari
if (window.XMLHttp Request)


You are feature-testing the mere _existence_ (to be more exact: the
_true-value_) of a property of _`window'_ ...
request = new XMLHttpRequest( );


.... but you _construct_ with a _method_ of the _Global Object_.


So what?
Furthermore, you do not declare `request', and so it becomes a property of
the Global Object, /iff/ there is no other object in the scope chain where
this applies to. Both approaches are error-prone.
Now, once again, please name a browser that does not implement the
window as the Global Object. And especially a browser that supports
window.XMLHttpR equest where window isn't the Global Object.

Your ranting about window not being the Global Object gets old.
Your code style allows for improvement. For example, do not use tabs;
use spaces.
There are problems with the posting style, but the coding style is
perfectly acceptable. Code any way you want, just pretty it up to post
it to Usenet.
// Error

if(!request)
alert("XHR Object cannot create");


The content of those message boxes is useless to Joe User, so you better
make them debug messages only.

var _global = this;


Unneeded Global Variable.
function isMethod(a)
{
return a && /\b(function|obj ect)\b/.test(typeof a);
}

function getImage()
{
var request = null;

if (isMethod(_glob al.XMLHttpReque st))
Nonsense test.
{
request = new XMLHttpRequest( );
}
else if (isMethod(_glob al.ActiveXObjec t))


Nonsense test.

But, once again, nothing you posted had anything to do with the problem.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 22 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2209
by: Simon Wigzell | last post by:
Can I turn off that annoying little box with the save/print/send etc. icons in it that IE pops up whenever I mouseover a picture in my browser? I mean in my own web pages is there something I can add to the <img> tag to prevent this rather than turn it off in the browser (Though that would be good too! Same thing is available through right mouse click, who needs it???) Thanks!
2
2204
by: TeknoCat | last post by:
Hey everyone, I may be repeating myself here, but if someone sent a reply then I missed it, and I can't get Outlook Express to download any messages more than 2 days old. Anyway, I'm having a problem with some new pages I am creating for the Web site at www.weaverdevore.ca and I am wondering if anyone here might be able to help. Here is a full description of the problem:
10
2334
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a similar name to the table. Rather than making a long Select Case that could become obsolete if lookup tables are added and the source table of the ListBox is edited I came up with this code.) This code works but of course it gives me build...
3
1127
by: bill | last post by:
There's a page that I frequently need to use, but I find that I cannot bookmark it, because it starts with if (parent.location.href == self.location.href) { // change the url below to the url of the // frameset page... window.location.href = 'index.html'; ? The desired page can be reached from index.html, of course, but one has to follow several links to get there. VERY annoying!
6
2071
by: mark | r | last post by:
how do i automatically trigger functions like displaydate() in SP2 without getting that annoying security error. i use things like these almost every time on sites (see www.sicl.co.uk for my latest :) and its doing my head in. mark
15
2188
by: 50295 | last post by:
Hi everyone, This one is better experienced than explained, so I'm including a code sample below. Please and save (as an html file) and view with NN or Firefox (or maybe even Mozilla), and then view. When loaded: (1.) Place the mouse over "Top Menu" item. (The menu opens) (2.) Move to any of the sub-menu items. (3.) Click on the left or right (but NOT on the text) of the current
2
1561
by: horos | last post by:
just another thing.. for people who are trying to replace a url outside of a form and who are searching for an answer - when you are trying to use the document.location.replace("") method for going to another url, you have to put false on the end of your return statement and call the function in the form of: onsubmit="return(make_url());" Why? Apparently there is an 'event bubble' that happens when you are doing a POST method call,...
2
1758
by: Vijay Kerji | last post by:
Hi, Please go through the following scenario. 1)On Button click, Parent window opens a child window using showModalDialog 2)Button is a server control and showModalDialog script is registered using the following code: string scriptblock = "<script language='javascript'>returnValue = window.showModalDialog('Datagrid1.aspx', 'xxx');" + "if(returnValue == 0) window.open('Webform1.aspx', '_self'); else
5
1449
by: nospam | last post by:
I think there is a flaw/bug in ASP.NET or IIS. I try to test my pages in Firefox Browser because it's better than IE (page source coloring, tabbed browsing, etc.) but the JavaScript that is generated for ASP.NET compile errors doesn't work on Firefox (try clicking on the JavaScript link to view the complete code). I'm using ASP.NET/C# on Windows XP Pro/IIS. I'm getting JavaScript errors from the ASP.NET generated JavaScript:...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.