0

この電話をかけるときにどうすればいいですか

 client.notification("test", "test", function(){
      alert("Hello world");
 });

「client.notification」で function(){....} 内のものを呼び出すことができますか?

元。

var client = ({"notification" : function(a,b,c){
    document.write(a + b);
    if ( .... ) {
        //call the alert stuff from the function "c"
    }
});

私はこれを試しました:

$('#notification').click(eval(c));

運がなければ

4

1 に答える 1

0

これを試して:

var client = ({"notification" : function(a,b,c){
    alert('inside of notification');
    c.call(); // or even `c()`
}});

client.notification("test", "test", function(){
    alert("inside of callback");
});
于 2013-02-17T09:51:20.460 に答える