2013-02-17 2 views
0

Comment puis-je faire alors quand je fais cet appelAppelez la fonction javascript de l'appel?

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

Je peux appeler les choses à l'intérieur de la fonction() {....} dans « client.notification »?

ex.

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

J'ai essayé ceci:

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

sans chance

+0

Comme toute autre fonction. 'c()' – JJJ

+0

Merci, poster comme réponse. –

Répondre

0

essayez ceci:

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"); 
}); 
Questions connexes