konekt
New Member
- Messages
- 100
- Reaction score
- 0
- Points
- 0
Important thing to note: the following codes are to be called from a firefox extension that I am working on.
With the following Javascript code, I get this error:
Error: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: http://konekt.x10hosting.com/konekt.js :: wut :: line 7" data: no]
Source File: http://konekt.x10hosting.com/konekt.js
Line: 7
The code is like this:
I am trying to call the .js file from my localhost, however, the .js and .php are on the same sever (same folder too), so I shouldn't be getting a permission error. I'm not sure what the problem is.
Another interesting thing is that if I press the button twice, I'll get the "OMG!! IT WORKS!" but the register.php will not have done anything.
EDIT:
Ok, it seems like this is telling me the file is not found. However, when I try to give it a more specific path like:
http://konekt.x10hosting.com/register.php?etc...
I get a permission error -_-
With the following Javascript code, I get this error:
Error: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame :: http://konekt.x10hosting.com/konekt.js :: wut :: line 7" data: no]
Source File: http://konekt.x10hosting.com/konekt.js
Line: 7
The code is like this:
Code:
var http = new XMLHttpRequest();
function wut(event)
{
http.open("GET", "register.php?user=emin&pass=dud", true);
http.onreadystatechange = useHttpResponse;
http.send(null);
}
function useHttpResponse()
{
if(http.readyState == 4)
{
alert(http.readystate);
alert("OMG IT WORKS!!!");
}
}
var button = document.getElementById("norm");
button.addEventListener('command', wut, true);
I am trying to call the .js file from my localhost, however, the .js and .php are on the same sever (same folder too), so I shouldn't be getting a permission error. I'm not sure what the problem is.
Another interesting thing is that if I press the button twice, I'll get the "OMG!! IT WORKS!" but the register.php will not have done anything.
EDIT:
Ok, it seems like this is telling me the file is not found. However, when I try to give it a more specific path like:
http://konekt.x10hosting.com/register.php?etc...
I get a permission error -_-
Last edited: