RockyCode

10 results for technology, jquery...

Stopping the dreaded double-form submission with jQuery

posted by Ted on 02 Aug 2010

When developing forms, we web developers always have to guard against the dreaded double-form submit, when impatient (or even patient) users, depending on the latency of form submissions, hit the “submit” or “enter” button multiple times, causing havoc to the application.

Submitting a form from an a href link using jquery

posted by Ted on 20 Jul 2010

Okay, Okay, I admit it. I'm javascript challanged. As a Java developer, I've looked down my nose at paltry javascript, treating it as a "me-too" technology trying to cash in on the hype surrounding java all these years.
As a result, I've missed out on a lot of js goodies. And, with javascript entering a renaissance of sorts, combined with the wildfire-like buzz surrounding libraries such as jquery, it's high time I learn some.

Jquery Plugin: safesubmit

posted by Jake on 28 Jun 2010

Jquery gives a great, easy-to-use mechanism for extending its API and creating your own plugins. For stuff that looks like it could be useful generally, you should really try to put it into a nice little plugin package. For submit buttons, there is a general thought that they shouldn't be clicked twice (especially for functions such as financial transactions), so I created a plugin that fits an app that I have been working on recently, where there are many, many submit buttons, saving very granual pieces of content through ajax requests.

Jquery Plugin: readmore

posted by Jake on 28 Jun 2010

Jquery plugins are a joy to use, and they are surprisingly easy to write. Everyone that writes lots of Jquery code should seek to take potentially-resuable functionalities of code and put them into a nice, compact plugin. In the app I've been working on, we have a lot of user-generated content that we don't limit the length on, so it can grow very large. To combat this, there is the UI pattern on the site that there is a "read more" link available to show the remaining text for the long-winded texts, while just showing a snippet otherwise. This exists everywhere, for lots of different content; hence, the "readmore" plugin was born.

Add/Remove Classes with Raw Javascript

posted by Jake on 19 May 2010

Jquery and other sweeto js frameworks have some awesomeness to help you change the css classes of various elements on the page with ease and grace. They have some very convenient functions to add and remove classes. These are uber-useful and highly recommended for saving you precious time and jiggawatts, but if you don't have jquery available to you, sometimes you may want to do this in raw javascript.

Pass Parameters to Javascript Callback

posted by Jake on 09 Sep 2009

Callback functions are a nice feature of Javascript. It's nice to be able to just use a function handle to show that it should be called when a certain something completes. Sometimes, however, we want to do more than just specify a function handle. We want to pass parameters. Why? Because sometimes the callback method cares about other data that was available before the original request. Here's an example:

Pass Parameters to Jquery Event Functions

posted by Jake on 08 Sep 2009

Jquery has some awesome event-handling abilities. The elusive ability to pass parameters into these event callbacks seems way harder than it should be. Nevertheless, I have found *a* solution. I really doubt it's the best one. I really hope it isn't.

JSF Modal Goodness

posted by Jake on 30 Nov 2008

Meet the new web. The simpler the better. The cleaner the better. The more pleasing the colors the better. The fuzzier feelings the better. The latest fuzzies have been brought on by a slew of modals. Previously, we haven't used many modals in our layouts and designs, so here's the first working pattern on how to get this kind of stuff working.

This solution allows:


  • Content to appear in a modal

  • Validation errors post back to the modal

  • Edits made in a modal persist back to the database

  • Success messages appear on parent page

Id's from JSF, used in jQuery

posted by Jake on 22 Nov 2008

For our view layer on our current project at work, we use JSF/Facelets + some jQuery goodness. I have found that at some times these two tech's have a hard time working with each other. I ocassionally have problems with the id's. Here's a nice little way to guarantee you id's are awesome.

ManyToMany Relationships in JSF

posted by Jake on 22 Sep 2008

What a journey of discovery! I haven't done much many-to-many relationship management in JSF. Django makes it quite easy. But at work recently, I did it in JSF. It was quite the experience, hereafter chronicled.