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

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -