Posts Tagged ‘javascript’

Find on this Page

Thursday, July 17th, 2008

Just about all browsers have a find on page option in the menu and so adding an equivalent option using JavaScript may not appear all that useful. It doesn’t work completely the same way as the built in ones do though since it uses a separate browser window rather than a dialog box and therefore doesn’t need to be closed in order to continue interacting with the page.

Find on this Page

Your Favourites

Saturday, July 5th, 2008

This example of my cookie toolbox in action allows you to set up a web page on my site that links to your fifty favourite web pages.

Your Favourites

A Cookie ToolBox

Friday, July 4th, 2008

Cookies are the main way of retaining information between one web page and the next and the only way to retain information between different browser sessions. Cookies are supported by both JavaScript and server side processing. Cookies are however limited in the amount of data they can store. Each domain can store up to 20 cookies with up to 4k of data in each with a maximum of about 300 cookies being able to be stored in total.

By using my cookie toolbox you make processing of cookies in JavaScript easier as well as being able to store an array of values into a single cookie.

A Cookie ToolBox

Limiting Textarea Text

Wednesday, July 2nd, 2008

Unlike normal input text fields where you can specify a maxlength attribute, there is no HTML equivalent for textareas. Instead if we want to limit the amount of text that can be entered in the browser rather than just truncating the textarea after it is submitted we need to use JavaScript.

Limiting Textarea Text

Default Values for Arguments

Tuesday, July 1st, 2008

Most programming languages have a really obvious way of assigning default values to function arguments for when that parameter is omitted. JavaScript has a not so obvious but far more flexible way of doing it.

Default Values for Arguments

In the Classroom

Sunday, June 15th, 2008

As well as all the tutorials that I put online to teach people over the web, I also teach several classes fact to face in the classroom. For anyone who lives in Sydney, my classes for term three are now organised including my new JavaScript course.

In the Classroom

Overlay Messages

Thursday, June 12th, 2008

The extended tooltip script places content in a “layer” above the main content of the web page. We can use that same technique to overlay other content on top of our main page for all sorts of other purposes.

Overlay Messages

Extended Tooltips

Wednesday, June 11th, 2008

A tooltip is the yellow box that most browsers display text in when you hover over an element in the web page that has a title attribute. Not all browsers display the title attribute as a yellow box to contain the text, some display the text in the status bar instead. The other limitation is that you can only include plain text in the title attribute to display in the tooltip. We can get around all these limitations and make the tooltip look however we like by generating the tooltip from JavaScript instead.

Extended Tooltips