www.webdeveloper.com
Results 1 to 3 of 3

Thread: Ajax.PeriodicalUpdater not updating asynchronously

  1. #1
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654

    resolved [RESOLVED] Ajax.PeriodicalUpdater not updating asynchronously

    Hullo there. This script below is being called onload of my page using the following code...
    HTML Code:
    <body onload="javascript:testit('testdiv','/ajax.php')">
    My problem is that it only semi works. If I remove the url = url + '?BogusVariable=' + new Date; line then if I refresh the page that the sql query is on, it will then update. But I was told by Bokeh in the PHP forum that this was a caching issue and to append th date onto the url as a variable. This then stops the script from working all together. I have been through countless examples but nowhere seems to have an example of what I'm trying to do. Can anyone help me get a working example?
    http://gramac4.freeserverhost.com/test.php si the link

    Code:
    <script type="text/javascript">
    	testit = function (id,url){
    	url  = url + '?BogusVariable=' + new Date;
    		new Ajax.PeriodicalUpdater(id, url,   
    		{
    			method: 'get',
    			frequency: 1,
    			asynchronous: true,
    			insertion: Element.update,
    			decay: 2   
    		});
    	}
    
    </script>
    Last edited by Dopple; 02-27-2007 at 04:18 AM. Reason: resolved

  2. #2
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654
    Incidentally as a test script I changed the sql atatement and the loop to...
    PHP Code:
    <?php
        $time 
    time();
        echo 
    $time;
    ?>
    so that I wouldn't have to keep adding an entry into the database to test this. It still won't work though. Is there something I am missing here? I have tried every combination of the script that I can find on the internet and am having no luck at all.

  3. #3
    Join Date
    Aug 2004
    Location
    70 klicks above the Do Lung bridge
    Posts
    654
    If anyone is interested here's what the problem was. It was caching only in IE and the solution? change the 'get' method to 'post'.
    You live and learn eh?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles