2

i make a progress bar in a modalbox like this

<div class="progress progress-info">
  <div class="bar" style="width: 0%"></div>
</div>

i change the content of a div with ajax like this

function download_inicio()
{
    $.ajax(
    {
        url:'/inicio',
        cache: false,
        type: 'GET',
    }).done(function(web)
    {
        $('#contenido_nav_principal').fadeOut(600,function()//hide the div
        {
            $('#contenido_nav_principal').empty();// empty the div
            $('#contenido_nav_principal').html(web);//changing html 
            $('#contenido_nav_principal').fadeIn(600);// fade in the div
        });
    });
}

so i want to update the progress bar with the percentage of the receive data from the server... the data is the html received from the url:/inicio

the server is on nodejs listening on

app.get('/inicio',routes.inicio.inicio);

tnx all!

Phil
  • 200
  • 10
andrescabana86
  • 1,778
  • 8
  • 30
  • 56
  • Related http://stackoverflow.com/q/76976/1331430 – Fabrício Matté Feb 03 '13 at 23:57
  • sry i read that and i cant understand how to implement in nodejs and jquery – andrescabana86 Feb 04 '13 at 05:34
  • Basically you will have to set a `Content-Length` header (with `response.writeHead`), then you will need to access the native XHR object from jqXHR to set an `onprogress` handler e.g. using [this](http://stackoverflow.com/a/6252513/1331430) (or native XHR as in the linked answer above) then just use the code from first linked question above in the handler. – Fabrício Matté Feb 04 '13 at 10:54

0 Answers0