Ultimate Web Tips

your Wordpress, jQuery, PHP, MySQL, Linux and CSS guide to a successful website
Read more:
Archive for the ‘jQuery’ Category

jQuery offers a very powerful range of tools to select elements. These are influenced from CSS and some created of their own.

HTML5 introduced many new features, one of them is the placeholder attribute. What it does is showing text in a field until any value is entered, then hides the text. Very useful to show users example of what to enter in a field. You’ve probably seen this techinque a lot with Javascript, but native HTML5 support is even better.

October 18th, 2011

Use hosted jQuery CDN

No Comments, jQuery, by Joakim Ling.

There are several reliable content delivery networks that are free to use to host your jQuery file. These are widely used and the chance that the client has it cached in browser are high. Both Google and Microsoft are available for public use.

July 25th, 2011

How to use jQuery click function

1 Comment, jQuery, by Joakim Ling.

This is an event handler to the “click” Javascript event, or trigger that event on an element. Any HTML element can trig a click event not only buttons and links and its event is sent when the mouse pointer is over the element and the mouse button is released.

jQuery has two API methods that provide similar event delegation functionality: live and delegate. Event delegation is a powerful technique that is often used in JavaScript applications. On the surface live and delegate can seem interchangeable. However, they are not. Live has several serious disadvantages and should never be used, and this article will explain why.

This is probably the first thing to learn about jQuery. Everything inside the $(document).ready() function will execute as soon as the DOM is registered by the browser and before the page contents are loaded. So if you want an event to work, call it inside this handler. This means that everything you stick inside the brackets is ready to go at the earliest possible moment, which allows hiding and showing effects and other dynamic functionality when the user sees the page elements.

How to change data of a div element using an AJAX jQuery GET request. The jQuery get() method is used to perform an AJAX HTTP GET request.

Let’s say you want to track all A tags with a specific href value with Google Analytics. This is quite simple and very useful if you want to see how many clicked on open a dialog, gallery etc.