如何使用javascript调用此代码的其他JavaScript?

时间:2014-09-10 10:38:04

标签: javascript jquery html

如何使用javascript调用此代码之类的其他javascript?

............................................... .................................................. .................................................. ..................

http://jsfiddle.net/peap/bjdq3oL3/1/

<script src="http://code.jquery.com/jquery-1.7.2.js"></script>
<form method="post" id="form_content" action="Javascript:void(0);">
    <button id="desc" name="desc" value="desc" style="display:none;">desc</button>
    <button id="asc" name="asc"  value="asc">asc</button>   
</form>

<script>
$(document).ready(function(){
    $('#form_content button').click(function(){
        $('#form_content button').toggle();
        var numbers = this.id;
        function_two();
    });
});

function_two(){
      alert('numbers');
}
</script>

1 个答案:

答案 0 :(得分:3)

function_two(){
    alert('numbers');
}

需要声明为函数

function function_two(){
    alert('numbers');
}

http://jsfiddle.net/bjdq3oL3/2/