Hello, bakers!
In the example below, I'm calling two ajax requests in sequence so
that two divs(id=view_first, view_second) are updated totally
independantly. Since updating requires some time, I have a "progress
bar" div(id=loading) to show which div is being updated. But
currently, only "Loading..." is shown while all divs are updated. How
can I make it show things like "Loading first div", "Loading second
div" and so on? I know that two divs (one shows "Loading first div",
and the other shows "Loading second div") will simply solve the
problem, but I am planning to increase the number of contents divs up
to 10, and don't want to have as many "progress bar" divs as the
contents divs. Are there any ways to use one "progress bar" div for
all contents divs?
My second question is "This code example works. But can I make more
improvements?"

//index.thtml
    <?php
    $options = array(
        'update'   => 'view_first',
        'url'      => '/demos/first/',
        'type'      => 'asynchronous',
        'loading'  =>
"Element.hide('view_first');Element.show('loading')",
        'complete' => "Effect.Appear('view_first')"
    );
    echo $javascript->event('window','load',$ajax-
>remoteFunction($options),false);
    ?>

    <?php
    $options = array(
        'update'   => 'view_second',
        'url'      => '/demos/second/',
        'type'      => 'asynchronous',
        'loading'  =>
"Element.hide('view_second');Element.show('loading')",
        'complete' => "Effect.Appear('view_second')"
    );
    echo $javascript->event('window','load',$ajax-
>remoteFunction($options),false);
    ?>

<div id="loading" style="display:none;padding:4px;color:black;
    background-color:#FAD163;width:100px"><strong>Loading...</strong></
div>
<div id="view_first" style="display:none;background-color:#E8EEF7;
    padding:4px;border:1px solid silver;width:800px"></div>
<div id="view_second" style="display:none;background-color:#E8EEF7;
    padding:4px;border:1px solid silver;width:800px"></div>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to