1. 程式人生 > >js呼叫jQuery中函式的方法和jQuery呼叫js中函式的方法

js呼叫jQuery中函式的方法和jQuery呼叫js中函式的方法

js呼叫jQuery方法:

function getResult(){
    //呼叫方式
    $().getFuc();
};
//獲取文字框值
$(function(){
    //名字為getFuc的jQuery方法
    $.fn.getFuc=function(){
        alert("1111111111111");
    }
});
 jQuery呼叫js方法:

$("#button3").click(function () {
        getFuc();
    });
function getFuc(){
       alert("111111");
}