DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 1 of 1

Thread: http adjustment needed.

Threaded View

  1. #1
    Join Date
    Dec 2006
    Posts
    8

    http adjustment needed.

    Hi, how to make this alert the response text in a divider with the id of
    "content" instead of the whole page of "test.txt" ? It works fine as it stands now, I just need it to show text in a div only and not the whole test.txt page. Thank you very much.


    xmlhttp.open("GET", "test.txt",true);
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
    alert(xmlhttp.responseText)
    }
    }
    xmlhttp.send(null)


    I tried this but its still looking for a page, not a divider.


    </style>
    <script type="text/javascript" src="http://www.website.com/test.js"></script>
    <script type="text/javascript">
    document.getElementById=("update_div");
    xmlhttp.open("GET", "update_div",true);
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4) {
    alert(xmlhttp.responseText)
    }
    }
    xmlhttp.send(null)
    </script>
    </head>
    <body>
    <div id="update_div">Testing this text to see if it appears. But it doesn't.</div>
    </body>
    </html>
    Last edited by Melanie; 12-18-2006 at 07:51 PM.

Similar Threads

  1. Replies: 0
    Last Post: 10-17-2006, 05:19 AM
  2. Http
    By freesoft_2000 in forum Java
    Replies: 12
    Last Post: 08-03-2005, 12:50 PM
  3. Custom HTTP modules & Web Services
    By Andrei Coler in forum .NET
    Replies: 0
    Last Post: 08-20-2003, 11:00 AM
  4. Re: Why REST is a better way to do Web Services
    By Michael D. Kersey in forum .NET
    Replies: 2
    Last Post: 08-30-2002, 12:05 AM
  5. Replies: 7
    Last Post: 09-15-2000, 08:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center