Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 66863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:10:12+00:00 2026-05-10T19:10:12+00:00

Im just writing a small Ajax framework for re-usability in small projects and i’ve

  • 0

Im just writing a small Ajax framework for re-usability in small projects and i’ve hit a problem. Basically i get a ‘NS_ERROR_ILLEGAL_VALUE‘ error while sending the request and i’ve no idea what is happening.

The HTML Page (trimmed but shows the error)

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>  <html xmlns='http://www.w3.org/1999/xhtml'>      <head>          <title>Ajax Test</title>          <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />           <script type='text/javascript'>              var COMPLETE = 4;             var OK = 200;              function GetXMLHttpRequestObject()             {                 var XMLHttpRequestObject = false;                  if(window.XMLHttpRequest)                 {                     if(typeof XMLHttpRequest != 'undefined')                     {                         try                         {                             XMLHttpRequestObject = new XMLHttpRequest();                         }                         catch (e)                         {                             XMLHttpRequestObject = false;                         }                     }                 }                 else if (window.ActiveXObject)                 {                     try                     {                         XMLHttpRequestObject = new ActiveXObject('Msxml2.XMLHTTP');                     }                     catch (e)                     {                         try                         {                             XMLHttpRequestObject = new ActiveXObject('Microsoft.XMLHTTP');                         }                         catch (e)                         {                             XMLHttpRequestObject = false;                         }                     }                 }                 else                 {                     XMLHttpRequestObject = false;                 }                 return XMLHttpRequestObject;             }              //The Main Ajax Object             function AjaxRequest(p_RequestMethod, p_DestinationURL)             {                 this.XMLHttpRequestObject = GetXMLHttpRequestObject();                  this.RequestedMethod = p_RequestMethod;                 this.DestinationURL = p_DestinationURL;                  this.XMLHttpRequestObject.open(this.RequestMethod, this.DestinationURL);                  this.OnStateChange = function(Callback)                 {                     this.XMLHttpRequestObject.onreadystatechange = Callback;                 }                  this.Send = function(p_Content)                 {                     this.XMLHttpRequestObject.send(p_Content);                 }                  this.GetState()                 {                     return this.XMLHttpRequestObject.readyState;                 }                  this.GetResponseText = function()                 {                     return this.XMLHttpRequestObject.responseText;                 }                  this.GetResponseStatus = function()                 {                     return this.XMLHttpRequestObject.status;                 }                  this.GetResponseStatusText = function()                 {                     return this.XMLHttpRequestObject.statusText;                 }             }              var Request;              function GetData()             {                 Request = new AjaxRequest('POST', 'http://www.kalekold.net/ajax/Ajax.php');                 Request.OnStateChange = StateChange;                 Request.Send();             }              function StateChange()             {                 window.alert('State: ' + Request.GetState());                 window.alert('Response: ' + Request.GetResponseStatus());                 window.alert('Response Text: ' + Request.GetResponseStatusText());                  if(Request.GetState() == COMPLETE && Request.GetResponseStatus() == OK)                 {                     Result = Request.GetResponseText();                     window.alert(Result);                 }             }         </script>       </head>      <body>          <form>             <textarea name='TextArea' rows='10' cols='80'></textarea><br />             <input type='button' value='Load' onClick='GetData();'>         </form>     </body>  </html> 

The PHP File:

<?php $XML = <<< PROLOG <?xml version='1.0' encoding='iso-8859-1'?> PROLOG;  $XML .= '<results>';     $XML .= '<result>';         $XML .= '<FirstName>Gary</FirstName>';         $XML .= '<SecondName>Willoughby</SecondName>';         $XML .= '<Age>35</Age>';     $XML .= '</result>';     $XML .= '<result>';         $XML .= '<FirstName>Sara</FirstName>';         $XML .= '<SecondName>Gostick</SecondName>';         $XML .= '<Age>35</Age>';     $XML .= '</result>'; $XML .= '</results>';  header('Content-Type: text/xml'); echo $XML; ?> 

The full error:

uncaught exception: [Exception... 'Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]'  nsresult: '0x80070057 (NS_ERROR_ILLEGAL_VALUE)'  location: 'JS frame :: http://www.kalekold.net/ajax/ :: AjaxRequest :: line 63'  data: no]  Line 0 

I just can’t see where it’s going wrong, any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:10:12+00:00Added an answer on May 10, 2026 at 7:10 pm

    The exception ‘Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)’ is caused by an illegal value being passed into the call of open method.

    Looking through your code I found misspelling:

     this.RequestedMethod = p_RequestMethod; this.DestinationURL = p_DestinationURL;  this.XMLHttpRequestObject.open(this.RequestMethod, this.DestinationURL); 

    See this.RequestedMethod property set to p_RequestMethod and this.RequestMethod being passed into the call of ‘open’ method.

    Also, instead of creating your own wrapper, I would recommend using open-source XMLHttpRequest.js – Standard-compliant cross-browser XMLHttpRequest object implementation, that also fixes some 20 bugs of browser’s native XMLHttpRequest object implementations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 92k
  • Answers 92k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer 1.) I think it does. MVC gives you full control… May 11, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer Create a "withoutdeps" version of the target. If you had… May 11, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer There's Futures library making its way into Boost and the… May 11, 2026 at 6:32 pm

Related Questions

Im just writing a small Ajax framework for re-usability in small projects and i've
I have a big problem writing a small piece of code using JS/jQuery (don't
I'm writing a small application in VB.NET and I would like some of the
I'm writing a small app for my friend's business, and thought I'd take the
I'm writing a small program to convert a standard definition 4:3 video to a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.