Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: HTTP Status 0 and Response Text is Undefined in Gadget, but work in IE

15 Mar 2013   #1

32
 
 
HTTP Status 0 and Response Text is Undefined in Gadget, but work in IE

Hi,

I have tried javascript code to access the Campfire API. It uses the HTTP Basic Authentication method. The code work in IE9, but while running the gadget actually, the AJAX fails, the HTTP status is 0 and response text is empty.

The javascript code is:


Code:
var URL_User = "https://zssd.campfirenow.com/users/me.xml";

if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      
      //xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      $("#response").append("Different Object<br>");
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
      

    
    var time1 = new Date().getTime()

    var auth = make_base_auth(usr,passwd);
    
    xmlhttp.open("GET",URL_User,false);
    

    xmlhttp.setRequestHeader('Authentication','OAuth ' + auth);
    xmlhttp.setRequestHeader('content-type','json');
    
    

    xmlhttp.send(null);
    
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        var response = xmlhttp.responseText;
                $("#response").append("<pre>"+response+"</pre>");
                //or something else to be done with response
        }
        else
        {
           
          
               $("#log").append(xmlhttp.readyState+"<br>");
               if(xmlhttp.readyState == 4)
               {
               $("#log").append(JSON.stringify(xmlhttp)+"<br>");
          
               }
        }

Plz help on this

My System SpecsSystem Spec
.

Reply

 HTTP Status 0 and Response Text is Undefined in Gadget, but work in IE





Thread Tools



Similar help and support threads for2: HTTP Status 0 and Response Text is Undefined in Gadget, but work in IE
Thread Forum
Solved Computer Status gadget (Shows no details) Gadgets
Solved Change status bar icons and text Customization
Undefined network, new router dlinkgo go-rt-n150 Network & Sharing
Undefined Network Problem Network & Sharing
I lost http connectivity but skype and magicjack work OK Network & Sharing
Rivatuner and GPU monitor gadget don't work Gadgets
Indexer Status Gadget Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 07:41 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33