Category: jQuery

JQuery-Mobile with AngularJS and Angular-Route (ngRoute)

JQuery-Mobile with AngularJS and Angular-Route (ngRoute)

Introduction The following details how JQuery-Mobile and AngularJS can play together seamlessly. Angular-Route (ngRoute) is used for navigation. A simple Angular directive invokes JQuery-Mobile styling and enhancements as each page is loaded. This includes pages loaded via  ng-include A working example is available here as a Plunker http://plnkr.co/edit/RPbJfWX84XkzWlvPFMvX?p=info

CORS Stateless REST Service with detached HTML5 client

CORS Stateless REST Service with detached HTML5 client

Introduction This blog will detail in precise steps how to create a stateless REST service that is consumed by a HTML5 client on another domain. The HTML5 client could easily be a Cordova or Phonegap app. The HTML5 client is simple and basic just for demonstration purposes. It shows the […]

A jQuery plugin: delayedClickAction

A jQuery plugin: delayedClickAction

A jQuery plugin to allow an element to be clicked many times before a specified action is performed. The action/event-handler will be invoked after a specified delay. Why? Example: Increment a qty multiple times by clicking before an ajax call is made. Applies to any jQuery query. i.e. a bunch […]

jQuery hasAttr() has Attribute plugin

jQuery hasAttr() has Attribute plugin

Straight from here: http://stackoverflow.com/a/4661989/1488103

  Use as so:

  Where the attribute being checked for is ‘rel’.  

jQuery-UI Split Button

jQuery-UI Split Button

Here’s how to create a split button with jQuery-ui $( “#mySplitButton” ).splitButton();

input and textarea html5 ‘placeholder’ attribute support in IE (or other non compliant browsers)–jQuery plugin

input and textarea html5 ‘placeholder’ attribute support in IE (or other non compliant browsers)–jQuery plugin

Which results in Where the text ‘Search Products’ disappears on focus and reappears on blur if the field is still empty. This text is not the ‘value’ of the field. In addition: If the value of the field is set to empty programmatically (using JS) the placeholder will appear […]

jQuery-UI – Rich Autocomplete component

jQuery-UI – Rich Autocomplete component

A problem with the out-of-box jQuery-ui autocomplete component is that: Only text is shown in the dropdown That same text populates the field upon list selection. Thankfully, this does not have to be the case. Images and other markup can easily be rendered in the suggestion list. Consequently, the text […]

jQuery – Fly to basket (and fly from basket)

jQuery – Fly to basket (and fly from basket)

The example below is a fully working Fly to Basket implementation. The image will fly to the center of the basket or fly from the basket back to where it came from.

Creating a dark semi-transparent modal overlay covering the whole page

Creating a dark semi-transparent modal overlay covering the whole page

This tutorial demonstrates how to do this with CSS and jQuery: I.e. placing a dark, semi-transparent, user-blocking/modal overlay (with a title in this case) over the whole page.

CSS – Removing the (new-line) spaces between inline elements

CSS – Removing the (new-line) spaces between inline elements

Observe the gap between the checkbox and the label on the second instance! This is a “feature” with inline (or inline-block) elements on a page. A new-line /carriage-return in the code is treated as white space between inline elements. While good advice would be to work with this rather […]

Flexible Size, Flexible Color Icons for jQuery-UI

Flexible Size, Flexible Color Icons for jQuery-UI

Different Icon Size, Different Icon Colors for jQuery-UI Achieving different size, different color icons in jQuery-ui and non-jQuery-ui web apps. This tutorial reveals how FontAwesome icons can be used rather than trying to resize existing jQuery-ui icons. I initially wanted jQuery-UI icons to be available in different sizes, for example: […]

jQuery-UI : change the color of a button using CSS classes

jQuery-UI : change the color of a button using CSS classes

In many web applications it’s necessary to have more than one color button, primary and secondary for example.

This tutorial demonstrates how to achieve this using only CSS.

jQuery-UI : Specifying different Button Icon colors using only CSS classes

jQuery-UI : Specifying different Button Icon colors using only CSS classes

Doing this:

Results in This tutorial demonstrates how changing the icon color can  be achieved.

jQuery-UI : Applying an Icon to a button using CSS classes

jQuery-UI : Applying an Icon to a button using CSS classes

This tutorial simply demonstrates a generic reusable JavaScript snipped which will allow you to specify Button Icon’s using only CSS classes. I.e. no need to apply Icons using JS anymore.

jQuery-UI : Changing the color of an icon

jQuery-UI : Changing the color of an icon

This quick tutorial demonstrates how to change the color of jQuery UI icons. e.g.

will result in red and blue icons respectively

Spring 3 MVC – Adding Objects to a List element on the fly at form submit – (Generic method)

Spring 3 MVC – Adding Objects to a List element on the fly at form submit – (Generic method)

Edit 10-Feb-2015 A much better approach to this problem is simply to use JSON. A number of comments below are in regard to nested lists. The solution detailed here does not readily facilitate nested lists. The solution outlined in this blog does: http://outbottle.com/spring-4-web-mvc-json-handling/. JSON is the recommended way of achieving “Adding […]

Spring 3 Web MVC – Exception Handling – incorporating AJAX

Spring 3 Web MVC – Exception Handling – incorporating AJAX

This tutorial demonstrates how to handle exceptions in Spring 3 Web MCV. Emphasis is given to Handling  exceptions that occur during AJAX requests. I.e. in the event of an exception during an AJAX request,  it is not desirable to redirect to an error page, instead JavaScript error handling code should be […]

jQuery load() – dynamically loaded content scripts are accessible and can access parent scripts?

jQuery load() – dynamically loaded content scripts are accessible and can access parent scripts?

The answer is yes actually. $(‘#dyn’).load(‘dynamic.html’) The scripts on the existing page can call the dynamically loaded scripts and the dynamically loaded scripts can call the existing static scripts.