CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 11 of 11

Thread: AJAX readyState = undefined

Threaded View

  1. #1
    Join Date
    Sep 2008
    The Netherlands

    AJAX readyState = undefined

    Hello Codegurus,

    The following piece of code returns a readystate that's "undefined".
    The alert appears 4 times in IE and in FF. so i reckon the readystate changes 4 times ?; but it's always "undefined".
    Could someone tell me what i'm doing wrong?, Thanks.

    EDIT: Sorry, just noticed the AJAX forum. feel free to move this topic.

    function xmlHttpRequest(){
    if (window.XMLHttpRequest)
      return new XMLHttpRequest();
    else if (window.ActiveXObject)
      return new ActiveXObject("Microsoft.XMLHTTP");
      alert("XMLHTTP not supported.");
      return null;
    function ajaxFunction(){
      var xhr = xmlHttpRequest();
      xhr.onreadystatechange = function(){
    Last edited by TimothyH; March 26th, 2009 at 04:29 AM. Reason: Wrong category

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)