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


sssweb - 7:11 pm on Jan 4, 2013 (gmt 0)


I think I got it; I needed to enclose the whole thing in the anonymous function. Like so:

jQuery.noConflict();

(function () {
var $ = jQuery;
function test() {
alert("window call / normal def");
$("#test2").fadeOut(1000);
}

jQuery(document).ready(function($) {
window["test"]();
});
})();

I'll play around with it and make sure it works in external files, etc; will re-post if I have more questions.

Thanks.


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