Why this javascript function not work on ie7 and 8 ?
When user click button , it's will display PLEASE WAIT.... and hide and then display TEST 
I test on firefox and chrome, It's OK
But not work on IE7 and 8 , How can i do that ?
index.php
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<form id="myForm" name="send_ask" action="test_e.php" method="post">
    <button id="sub">Send</button>
    <span id="loading" style="display:none;">PLEASE WAIT.......</span>
    <span id="result" style="display:none;"></span>
</form>
<script type="text/javascript">
$('#myForm').submit(function(e){
    e.preventDefault();
    $.ajax({
        url: $("#myForm").attr("action"),
        data: $("#myForm :input").serializeArray(),
        type: 'post',
        dataType: 'html',
        success: function(data){
            $("#result").html(data);
        },
        beforeSend: function(){
            document.getElementById("sub").disabled = true;
            document.getElementById("loading").style.display="inline";
            $("#result").hide()
        },
        complete: function(data){
            $("#result").show()
        }
    });
});
</script>
test_e.php
TEST
 
    