Posted at Jan 29, 2009 5:38:35 AM by Ronald Busky | Share
As developers we always keep our little things that we always use or start a project in the same mannerisms. Coming up later, I will write about how we lay the foundation for a project with our project template. But for now, I would like to show you how we have our jQuery foundation file layed out. Above and beyond the scope of this base file, everything past this point is decided by the individual project.
We have done many websites and somethings always seem to arise. So I decided "Why not just have them in the base file from the beginning." Right? of course.
So here is the file that we use for just such a thing.
So here is "jQuery Foundation .js"
When I use this, I have a set of things I always place inside the code that executes on the DOM.
1. External Links
Now many people do not like to use the target="_blank" anymore, since it's not standard anymore. Well why not use jQuery to make it happen.
This was just something that I add because well, sometimes you hit a link or a button or submit something by accident right? of course! we all do. Adding this little bit of code will help you try to avoid that, or at least deal with it a little better.
// IN DOM
// OUTSIDE DOM
var agree="Are you sure you wish to perform this action?nCheck your work!";
if ( confirm( agree ) )