Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- calling & defining functions using funcName() vs. window['funcName']()


sssweb - 2:45 pm on Jan 7, 2013 (gmt 0)


Well, the functions all run now, but I can't run jquery in them. Since the functions are defined outside jQuery(document).ready(function($){...}); I precede them on the page with:

var $ = jQuery;

But jquery commands in the functions only run if I put that statement INSIDE the function. I thought declaring it outside makes it global, and therefore available in the function.

Also, can I declare this globally in one place (instead of at the top of every js file) so that it's always available?


Thread source:: http://www.webmasterworld.com/javascript/4533285.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com