Re: [jQuery] JQuery Best Practices

2006-09-09 Thread Christof Donat
Hi, Essentially, anything that interacts with or manipulates the page must be within the $(document).ready() function. This is considered a best practice - the only alternative is to wrap your code in a $(window).load( ... ), but that is highly un-optimal. You could also put the script tag

[jQuery] JQuery Best Practices

2006-09-08 Thread Rey Bango
Is it the norm to start any page that uses JQuery with: $(document).ready(function(){ // Your code here }); All of the tutorials mention it so I'm just trying to figure out if its just something to help get us started or if its a best practice. Also, does all of the code used to

Re: [jQuery] JQuery Best Practices

2006-09-08 Thread John Resig
Is it the norm to start any page that uses JQuery with: $(document).ready(function(){ // Your code here }); All of the tutorials mention it so I'm just trying to figure out if its just something to help get us started or if its a best practice. Also, does all of the code used to

Re: [jQuery] JQuery Best Practices

2006-09-08 Thread Rey Bango
Hi John, Essentially, anything that interacts with or manipulates the page must be within the $(document).ready() function. This is considered a best practice - the only alternative is to wrap your code in a $(window).load( ... ), but that is highly un-optimal. Exactly what I wanted to know.

Re: [jQuery] JQuery Best Practices

2006-09-08 Thread sunsean
I think one of the niceties of jQuery is it's ability to compact code. That's about the only good practice I follow. Let me analyze a simple jQuery snippet for you to look at. Lets say we have the following code: a href=mailto:;user [AT] domain [DOT] com/a And we want to turn it into this: a