You Kuper
You Kuper

Reputation: 1113

javascript function is not executed

Why alert("Test1") is executed, while alert("Test2") is not executed? P.S. Currently I'm not using json data.

<script>
$(document).ready(function() {
    var param = 10;
           $.getJSON(
                       'modules/mod_scheduler/updateList.php?param'+param,
                       function(data)
                       {
                           alert("Test1");
                           find_optimal_schedule();
                       }
           );
    });
</script>

<script language="javascript">
function find_optimal_schedule() {
    alert("Test2");
    //...
}
</script>

Upvotes: 0

Views: 89

Answers (1)

Diego
Diego

Reputation: 7562

I'm not sure about it, but try changing this bit:

<script language="javascript">

into:

<script type="text/javascript">

And see if it runs.

Upvotes: 2

Related Questions