When using utility functions in Prototype library (e.g., F$), the element name must be surrounded by quotes. Firefox requires it to not include quotes, but IE does not.
This example does not work:
$F(sample);//DOES NOT WORK!!
This example does work:
$F(‘sample’);//DOES WORK!
This was tested with Firefox 3 and IE7 using Prototype 1.5.1.
Prototype has a number of handy utility methods. One of my favorites is the “$$” method, which allows you to select elements by class name. As with most other Prototype functions, this one can be chained to do some really cool stuff. Read the rest of this entry »
Widely hailed as the successor to XML in the browser, JSON aspires to be nothing more than a simple and elegant data format for the exchange of information between the browser and server. In this example we will learn how to create a JSON object on the client using JavaScript (and Prototype), and how to process that same JSON object on the server using Java. The examples use the Google JSON (or GSON) libraries for the JSON parsing. Read the rest of this entry »
Event handling in JavaScript is a great thing. Unfortunately, there are some cross-browser issues with event handling (IE rant omitted). Once again, Prototype comes to the rescue. Read the rest of this entry »
This article describes a technique that takes input from a text field and populates a dropdown list that matches the input text. This is similar to the “auto-complete” feature that is commonly used for search fields. Read the rest of this entry »
It’s easy to mix Java scriptlet (JSP) code and JavaScript code. Here’s how you can embed scriptlet code in your JavaScript code, using a simple example of setting a JavaScript variable: Read the rest of this entry »
There are some quirks to keep in mind when mixing JSTL with JavaScript code. Here’s how you can use JSTL to produce JavaScript code: Read the rest of this entry »