thanks.
On Sat, May 30, 2009 at 6:27 AM, MorningZ <morningz@gmail.com> wrote:
Why not fake a namespace instead?
"If i make a custom function my site uses a lot. i put it in a
plugin. :) "
like if you had
function toUpperCase() {
//your custom "to upper case" code that
//would conflict with JS's verion
}
simply saying
var waseem = {};
waseem.toUpperCase = function() {
//your custom "to upper case" code that
//would no longerconflict with JS's verion
}
would solve the issue....
back on topic, i haven't seen anyone suggest that the original code
be written like
$(function(){
function displayMessage(){ alert('hello world'); };
});
$(function(){
displayMessage();
});
$(function(){
function displayMessage(){ alert('hello world'); };
$(function(){
displayMessage();
});
displayMessage();
}
});
which makes a lot of sense, and is a super simple change
No comments:
Post a Comment