javascript - jasvascript call functions from different scripts -
i have 2 different script tags,can call function second..like this
<script> var = something; . . . <td onclick="myfunc("+something+")"></td> </script> <script> function myfunc(data){..} </script>
yes, can. functions @ global level. here example:
<script type="text/javascript"> function hi() { alert('hi'); } </script> <script type="text/javascript"> hi(); </script>
this indeed result in popup "hi".
jsfiddle: http://jsfiddle.net/we8pb7md/
Comments
Post a Comment