Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling function in external js file
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Calling function in external js file
Divers
Thread ID:
01628030
Message ID:
01628030
Vues:
40
This must be super newbie question.

If I create a javascript function in my page javascript, like the following:
function TestMsg()
{
  alert('Test Message');
}
everything works. In the javascript, before the above function is written, I can call:
TestMsg();
and Alert shows the message.

But if I move the above function to an external .js file (e.g. dmitry.js) as follows:
<script type="text/javascript">
function TestMsg() {
  alert('test message');
}
</script>
I check in the Chrome that the file dmitry.js is loaded. But when I call TestMsg(); in the javascript, nothing alerts.

What am I missing?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform