Hey Guys, I have 2 files. index.html and settings.js inside settings.js:
$(document).ready(function(){ function say_something(word){ alert(word); } }) inside index.html <script language="javascript"> $(document).ready(function(){ say_something("hello"); }); </script> I am using Firefox 2 with Firebug and it claims the function is not defined. The code does not work. So why is this a jQuery problem, you ask? Well, if I remove the $(document).ready call from the external file, everything works fine! this is what it looks like when it works: inside settings.js: // no $(document).ready call function say_something(word){ alert(word); } inside index.html <script language="javascript"> $(document).ready(function(){ say_something("hello"); }); </script> I've been searching Google and the forum for almost 2 hours now with no answer to why this does not work with $(document).ready. Any ideas? Thank you, Yuval p.s. replacing <script language="javascript"> with <script language="text/javascript"> simply suppresses the error, it does not solve the problem.