My question is about syntax, or how to wite jquery code.
Is the example below ok? Putting all your code between document.ready
all your code with anonymous functions?
$(document).ready(function() {
$('a.link1').click(function() {
//code
});
$('a.link2').click(function() {
Just put the calls to the functions that do the work inside of .ready().
Put everything else outside of it.
As for anonymous functions, they are good for creating a context that avoids
polluting your name space. When the function ends, everything defined
within disappears into oblivion unless
Now that we're switching to feature detection rather than browser
detection, how does/should one detect for a webkit browser?
Is there a known feature that we can check for that would Identify
Safari and Chrome?
We're running into some (rather minor) layout issues with some jquery
plug-in
Is the following syntax the proper way to bind and unbind event in plugin so
that you minimize the chance you will unbind and event that you did not set?
$(selector).bind('event.custom_tag', function);
so if you take the following:
$('#binding_test').bind('click.part1', function()
{
4 matches
Mail list logo