i can’t validate the random words for my game in JavaScript

I need help in my code by the way its a typing game that has timer and a life and a scoreboard im also a beginner in JavaScript my problem here is i want to snuffle again the word after the user got the answer correct or got the wrong answer sorry for my english

var words = ["PRINTF","SCANF","GETCH","MAIN"];
    var life;
    var seconds;
    var temp;
    var score=0;
    //Timer
    function countdown() {
    seconds = document.getElementById('countdown').innerHTML;
    seconds = parseInt(seconds, 10);
    if (seconds == 0) {
      temp = document.getElementById('countdown');
      alert("TIME IS UP!");
      document.getElementById("countdown") = 0;
    }
    seconds--;
    temp = document.getElementById('countdown');
    temp.innerHTML = seconds;
    timeoutMyOswego = setTimeout(countdown, 1000);
    }
   
    //Random
    var getRandomWord = function () {
    return words[Math.floor(Math.random() * words.length)];
    }
    var word = getRandomWord();  
    //Display
    function start(){  
    document.getElementById("display").innerHTML = word;   
    }

    // Validate the entered word
    function go() {
    var input = document.getElementById("demo").value;
    var input1 = input.toUpperCase();
     
    if (word==input1){
       alert('Correct');
       score=score+1;
       document.getElementById("score").innerHTML = score;
       start();
    }
    else 
    {
        alert('Wrong');
        start();
        life = document.getElementById('life').innerHTML;
        life = parseInt(life);
        life = life-1;
        document.getElementById("life").innerHTML = life;    
    }
    }

read more

Ajax: prevent refreshing page after submitting more than once

I have been used jQuery function to refresh the div but when i submit the form more than once page will be refreshed. I want to stop that refreshing and show the new contents like facebook comments updating. Please help me to solve this issue.

Here is my code:

<div class="row">
   <div id="right-side" class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
        <div id="profile_container">
            <div class="profile_items">
                <ul class="profile_ul">
                    <li id="personal-info">
                        <div class="profile_content">
                            <form action="" method="POST" id="personal-info-form" class="form-group">
                                <table>
                                <?php   foreach ($personal as $pdata) { ?>
                                <tr id="new_personal" class="pro-info-set">
                                    <td class="info-group-left">
                                        <p class="pro-info-left"><?php echo $pdata['js_personal_title']; ?></p>
                                    </td>
                                    <td class="info-group">
                                        <p class="pro-info-right"><?php echo $pdata['js_personal_desc']; ?></p>
                                    </td>
                                </tr>
                                <?php   } ?>
                                <tr class="pro-info-set">
                                    <td class="info-group-left">
                                        <input class="form-control" type="text" id="js_personal_title" name="js_personal_title">
                                    </td>
                                    <td class="info-group form-inline">
                                        <input class="form-control" type="text" id="js_personal_desc" name="js_personal_desc">
                                        <input id="submit_person" class="form-control" type="submit" value="Add">
                                        <label id="submit_person_msg" value="Add"></label>
                                    </td>                                       
                                </tr>
                                </table>
                            </form>
                            <script>
                                $(document).ready(function(){
                                    $("#submit_person").click(function(e){
                                        e.preventDefault();
                                        js_personal_title = $("#js_personal_title").val();
                                        js_personal_desc= $("#js_personal_desc").val();
                                        var datastr = 'js_personal_title='+js_personal_title + '&js_personal_desc='+js_personal_desc; 
                                        $.ajax({
                                            type: "POST",
                                            url: "<?php echo base_url().'index.php/Jobseeker/add_personal' ?>",
                                            data: datastr,
                                            success:function() {
                                                $("#personal-info-form")[0].reset();
                                                $(".row").load(location.href  + "#new_personal");
                                                $( "#submit_person_msg" ).append( "<p> Loading... </p>" );
                                            }
                                        });
                                    return false;
                                    });
                                });
                            </script> 
                        </div>                            
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>

read more

Ajax: prevent refreshing page after submitting more than once

I have been used jQuery function to refresh the div but when i submit the form more than once page will be refreshed. I want to stop that refreshing and show the new contents like facebook comments updating. Please help me to solve this issue.

Here is my code:

<div class="row">
   <div id="right-side" class="col-lg-9 col-md-9 col-sm-8 col-xs-12">
        <div id="profile_container">
            <div class="profile_items">
                <ul class="profile_ul">
                    <li id="personal-info">
                        <div class="profile_content">
                            <form action="" method="POST" id="personal-info-form" class="form-group">
                                <table>
                                <?php   foreach ($personal as $pdata) { ?>
                                <tr id="new_personal" class="pro-info-set">
                                    <td class="info-group-left">
                                        <p class="pro-info-left"><?php echo $pdata['js_personal_title']; ?></p>
                                    </td>
                                    <td class="info-group">
                                        <p class="pro-info-right"><?php echo $pdata['js_personal_desc']; ?></p>
                                    </td>
                                </tr>
                                <?php   } ?>
                                <tr class="pro-info-set">
                                    <td class="info-group-left">
                                        <input class="form-control" type="text" id="js_personal_title" name="js_personal_title">
                                    </td>
                                    <td class="info-group form-inline">
                                        <input class="form-control" type="text" id="js_personal_desc" name="js_personal_desc">
                                        <input id="submit_person" class="form-control" type="submit" value="Add">
                                        <label id="submit_person_msg" value="Add"></label>
                                    </td>                                       
                                </tr>
                                </table>
                            </form>
                            <script>
                                $(document).ready(function(){
                                    $("#submit_person").click(function(e){
                                        e.preventDefault();
                                        js_personal_title = $("#js_personal_title").val();
                                        js_personal_desc= $("#js_personal_desc").val();
                                        var datastr = 'js_personal_title='+js_personal_title + '&js_personal_desc='+js_personal_desc; 
                                        $.ajax({
                                            type: "POST",
                                            url: "<?php echo base_url().'index.php/Jobseeker/add_personal' ?>",
                                            data: datastr,
                                            success:function() {
                                                $("#personal-info-form")[0].reset();
                                                $(".row").load(location.href  + "#new_personal");
                                                $( "#submit_person_msg" ).append( "<p> Loading... </p>" );
                                            }
                                        });
                                    return false;
                                    });
                                });
                            </script> 
                        </div>                            
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>

read more