Question:

Javascript help? Please help me with this?

by  |  earlier

0 LIKES UnLike

how would i know if the progress bar is already hidden?

?******? : what shud i put in my condition?

here's my code:

<script type="text/javascript">

var bar1= createBar(350,7,'white',1,'green','blue'...

if(?*****?){

<?php

echo "process has been done succesfully!"

?>

}

</script>

 Tags:

   Report

4 ANSWERS


  1. There is something wierd with your logic...

    Unless the createBar function takes time and exits when the &quot;work&quot; is done, your code won&#039;t work as expected. You&#039;re looking for an &quot;event based&quot; code, but your writing procedural (e.g. sequential) code.

    Two possibilities:

    1- Split your code on 2 PHP pages: 1st page will display a progress bar, then upon completion, will display the 2nd page once the work is done.

    2- Use AJAX to do some work, then update a DIV with the innerHTML function to write stuff when your work is done.

    On the other hand, if you createBar function DOES exit when the work is done, then you&#039;re on the right track. Write something like this:

    &lt;div id=&quot;result&quot;&gt;&lt;/div&gt;

    &lt;script&gt;

    var myDIV = document.getElementById(&#039;result&#039;);

    myDIV.innerHTML = &#039;&lt;img src=&quot;progress.jpg&quot;&gt;&#039;;

    /* DO STUFF HERE */

    myDIV.innerHTML = &#039;Work Complete!!&#039;;

    &lt;/script&gt;

    Good luck!


  2. your code already looks a little strange...missing some characters and things.  what are you trying to do?

  3. Can you give us the complete script...including the function createBar()?

    That way we can see what your arguments are based on.

  4. if (bar2.visibility=&#039;visible&#039;)

Question Stats

Latest activity: earlier.
This question has 4 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions