Tester l’existence d’une fonction en Javascript

function test(){
  alert("test");
}

function func(){
  if('function' == typeof(test)){
    test();
  }
  else {
    alert("function not found");
  }
}

 


1 janvier 2016 - Wakonda - JavaScript

Rechercher

Tags

Publicité

Suivez-nous

Aidez-nous !


Loading…
Loading the web debug toolbar…
Attempt #