SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Addict
    Join Date
    May 2006
    0 Post(s)
    0 Thread(s)

    How to keep this firing

    Hello, here's a working http request. If you upload it named as anything.html along with a page named test.html, it will call whatever text you put in test.php It will put the text in the div id named T1.
    <script type="text/javascript">
    function myNewXMLobject(){
    var xmlhttp=false;
    try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
    xmlhttp = false;
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    try {
    xmlhttp = new XMLHttpRequest();
    } catch (e) {
    if (!xmlhttp && window.createRequest) {
    try {
    xmlhttp = window.createRequest();
    } catch (e) {
    return xmlhttp;
    function up()
    {"GET", "test.php",true);
    xmlobject.onreadystatechange=function() {
    if (xmlobject.readyState==4) {
    <body onload="up();">
    <div id="T1" style="border:1px solid black;height:100;width:150"></div>
    I need to know how to keep the request firing. So that after it pulls the page it will pull it again after so much time. I tried setInterval(' ',10000); but I didn't know where to put it and which function to use for it. I also didn't know if the body onload was keeping it from firing again. Please get back to me, I can really use some help on finishing this, thank you very much.
    Last edited by 1Jen; Apr 24, 2007 at 02:54.


Posting Permissions

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