jQuery UI Modal Dialog Primer Tutorial

jQuery UI Modal Dialog Primer Tutorial

jQuery UI Modal Dialog Primer Tutorial

A lot of the things people like about the Web are to do with JavaScript and client-side activities. Adding to that experience are Javascript libraries packed full of features. Probably the best known of these is jQuery.

Read more about the powerful jQuery Javascript library here (at its spiritual home) and here (at Wikipedia) … and in the previous relevant jQuery UI Dialog Primer Tutorial as shown below, which simulated the alert, confirm and prompt Javascript windows using jQuery functionality.

Today we have a modal dialog box which is movable, and this is a step up from the alert Javascript box, which can sometimes “get in the way” of something you want to see below. With this jQuery solution you get the best of both worlds, if you do not want to move on without getting an “answer” from the user, but also want the user to be able to see what is shown below, that, maybe, they will be able to reach if they “answer”. Have put the word answer in double quotes, because, today’s modal dialog box is most like the Javascript alert box, where, to answer, you can only press the “OK” button.

Click on picture above to go to jQuery page for a (live run) tutorial on a UI feature of jQuery called Modal Dialog.

Link to today’s HTML/Javascript/jQuery downloadable code you could call modal_dialog.html.

Link to jQuery information … via Wikipedia, from where quote above is derived.
Link to jQuery spiritual home page … via jQuery Foundation.
Link to jQuery download page … download jQuery UI code used, here.

Regarding this topic I really like “JavaScript & Ajax” seventh edition by Tom Negrino and Dori Smith pages 432 and 433. The code in this book was followed closely, with small amendments.


Previous relevant jQuery UI Dialog Primer Tutorial is shown below.

jQuery UI Dialog Primer Tutorial

jQuery UI Dialog Primer Tutorial

A lot of the things people like about the Web are to do with JavaScript and client-side activities. Adding to that experience are Javascript libraries packed full of features. Probably the best known of these is jQuery.

jQuery is a multi-browser JavaScript library designed to simplify the client-side scripting of HTML.[4] It was released in January 2006 at BarCamp NYC by John Resig. It is currently developed by a team of developers led by Dave Methvin. Used by over 55% of the 10,000 most visited websites, jQuery is the most popular JavaScript library in use today.[5][6]

jQuery is free, open source software, licensed under the MIT License.[7] jQuery’s syntax is designed to make it easier to navigate a document, select DOM elements, create animations, handle events, and develop Ajax applications. jQuery also provides capabilities for developers to create plug-ins on top of the JavaScript library. This enables developers to create abstractions for low-level interaction and animation, advanced effects and high-level, theme-able widgets. The modular approach to the jQuery library allows the creation of powerful dynamic web pages and web applications.

Click on picture above to go to jQuery page for a tutorial on a UI feature of jQuery called Dialog.

Link to jQuery information … via Wikipedia, from where quote above is derived.
Link to jQuery spiritual home page … via jQuery Foundation.
Link to jQuery download page … download jQuery here.
Link to jQuery UI Dialog page … jQuery UI Dialog (one of many jQuery UI ideas).

Download source code and rename to mydialog.html and
Download programming source code and rename to myconfirmdialog.html and
Download source code and rename to mydialogform.html

Did you know …
JavaScript makes a great easy-access Calculator?

Try typing the lines below into the address bar of your favourite browser:

Javascript: eval(512 / 380);
Javascript: eval(512 * 380);
Javascript: eval(512 – 380);
Javascript: eval(512 + 380);
Javascript: eval(512 % 380);

These days we spend so much time on the Internet it is a much quicker way to get to a calculator!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, GUI, Tutorials and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *