Javascript function refreshing page instead of div

I wrote this small javascript function to run every 4 seconds or so. All it does is it clears messages (text) in a div, these messages only appear if a user clicks a button when they’re not supposed to. The function seems to be refreshing the whole page though, not just the div. What am I missing?




<script type="text/javascript">

    function clearVoteMessages(){

        var message = document.getElementById('votingNotifications').innerHTML = '';

    }

</script>

Here’s the function, below is the div


<div id="voting_buttons">

		

      <?php  

       echo CHtml::submitButton('Vote', array('submit' => array('Vote/CheckIfPollIsOpen')));                      

      ?>  

    

     <div id="votingNotifications">

         <?php

            if(isset($isPollOpen) && $isPollOpen == false)

            {      

                $this->renderClip('cannotVoteYet');                                                   

            }


            if(isset($user) && $buttonClicked == true)

            {

                $this->renderClip('alreadyVoted');                

            }

         ?>

     </div>

</div>

First of all you wrote "seems to…" so you are not even sure if that is the case?

You need to check this with a tool like firebug to see what is going on here.

Yeah sorry, my language was a little ambiguous. I’ve solved that problem anyways.

Would be nice if you would write what was the problem and how you solved it, so that others with similar issue can benefit from that ;)

Yes I should do that, being a novice I just assume there isn’t much I can tell that most users won’t already know. I’ve scrapped the above idea anyways and went with something else.