Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: ActiveXObject

  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ActiveXObject

    Hi

    I'm trying to read data from 2 url's but the only one showing is the one containing
    data from codingforum, can someone help me out here ??

    Regards
    Carsten


    Code:
    function readURL(){
      objXml = new ActiveXObject("Microsoft.XMLHTTP");
    
      objXml.open("GET", "http://www.yahoo.com", true);
      objXml.onreadystatechange=function() {
         if (objXml.readyState==4) {
          alert(objXml.responseText);
        }
       }
    
      objXml.send(null);
      // alert("Now it's working !");  // IF I UNCOMMENT THIS LINE, EVERYTHING WORKS - WHY ??
      
      objXml.open("GET", "http://www.codingforums.com", true);
      objXml.onreadystatechange=function() {
         if (objXml.readyState==4) {
          alert(objXml.responseText);
        }
       }
    
      objXml.send(null);
     }
    Last edited by _carsten; 10-18-2008 at 03:58 PM.

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    because ur reusing the old object to make another request...
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

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