I am starting in web desing, and I have a problem with a javascript function in external file: My function javascript is like this:
function log()
{
alert("something");
$('#content').load('mod/lo.php');
}
And I call this function in html like this:
<script>log()</script>
and the script only shows the alert, the function load is ignored. But if I call the function like this:
<script>$(log);</script>
It works fine, the alert is showed and the load works.
What's the difference of these forms of calls?
I have search about this, but almost all the pages say that to call a function only put <script>function();</script>
Can anyone explain me the diferrence of this forms of call? there are problem when parameters are used?
Thanks and sorry for my bad English.