TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-26-2008, 01:36 PM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ER

Code:
uncaught exception: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIXMLHttpRequest.send]" nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame ::
What does this mean? heres my code:
Code:
<script type="text/javascript">

 try {
 xmlHttp = new ActiveXObject('MSXML2.XMLHTTP');
 } catch(e)
 {
  
}
try {
 xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {
  alert("Your Browser doesnt support AJAX");
}

try {
xmlHttp = new XMLHttpRequest();
} catch(e) {
 alert("AJAX n0t supported");
}



function Asx()
{
 xmlHttp.send("GET", "a.php", true);
 xmlHttp.open();
 var msg = document.getElementById('msg');

 xmlHttp.openReadyStateChange = responseAsx(); 
}

function responseAsx()
{
 msg.innerHTML = xmlHttp.responseText;

 if (xmlHttp.readyState == 4 )
 {
  msg.innerHTML = "Worked!";
 } else if (xmlHttp.readyState != 4 ) 
{
 document.write('Loading..');
 }
}
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 02-26-2008, 02:07 PM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2007
Posts: 154
Thanks: 31
SOCK is on a distinguished road
Default

You've confused / swapped the 'open' and 'send' methods. You should be using
Code:
xmlHttp.open("GET", "a.php", true);
xmlHttp.onreadystatechange= responseAsx;
xmlHttp.send(void);
You're also not using the responseAsx callback function correctly; notice how I've altered the code to use the name of the callback, not act as if it were a function call.

Wikipedia.org :: XMLHttpRequest
__________________
I reject your reality, and substitute my own.
SOCK is offline  
Reply With Quote
The Following User Says Thank You to SOCK For This Useful Post:
Orc (02-26-2008)
Old 02-26-2008, 02:12 PM   #3 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by SOCK View Post
You've confused / swapped the 'open' and 'send' methods. You should be using
Code:
xmlHttp.open("GET", "a.php", true);
xmlHttp.onreadystatechange= responseAsx;
xmlHttp.send(void);
You're also not using the responseAsx callback function correctly; notice how I've altered the code to use the name of the callback, not act as if it were a function call.

Wikipedia.org :: XMLHttpRequest
Now I get
Code:
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 34)
msg is not defined
[Break on this error] msg.innerHTML = xmlHttp.responseText;
test.html (line 34)
msg is not defined
[Break on this error] msg.innerHTML = xmlHttp.responseText;
:(, AJAX is harder than php. :P

More and More errors:
Code:
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 34)
msg is not defined
[Break on this error] msg.innerHTML = xmlHttp.responseText;
test.html (line 34)
msg is not defined
[Break on this error] msg.innerHTML = xmlHttp.responseText;
test.html (line 34)
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 34)
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 38)
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 34)
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 38)
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 34)
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 38)
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
[Break on this error] undefined
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 34)
Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
[Break on this error] undefined
test.html (line 38)
uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: /test.html :: Asx :: line 29" data: no]
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:25 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design