views:

48

answers:

2

This could be considered a browser problem. It works in firefox, but not IE or Chrome:

http://robotslacker.com/test.php

the php file it's posting to is simply outputting a number. If you load it in Chrome it loads at 99.

So the question is, how can i achieve the same affect on chrome/ie

A: 

This works (in my version of Chrome)...but hangs up the browser for quite a while.

function doStuff() {
    $.ajax({
        type: 'POST',
        url: '/ajax_html_echo/',
        data: {
            i:i
        },
        success: function(resp) {
            $("p").html(i);
        },
        dataType: "html",
        async:false
    });    
}

var i = 0, timerId = setInterval(function() {
    doStuff();
    if(++i == 10) clearInterval(timerId);
}, 100);
sje397
oops - you'll have to put the url back :) demo is [here](http://jsfiddle.net/UyYuZ/)
sje397
A: 

If you do the test in chrome, you'll notice that it pauses for a while before the 99 is displayed. Most likely it is working properly, it is just NOT displaying the intermediate 1-98 until the POST loop is done. This is on v5.0.375.125 (latest/greatest to date).

If you run the test in opera, it only outputs odd numbers.

Marc B