Jquery Error Fix Snippets


Example shown here how to preload the images with jquery in WordPress.

07 March, 2013   

This simple and handy jQuery filter return a single random item from a selection of items. Credit to Waldek Mastykarz

26 November, 2011   

In jQuery $ is an alias for jQuery, so you can use jQuery() for accessing the jQuery methods. The following code example shows how you can use other libraries with jQuery:

A bug seems to occur when you add a negative margin to a list item in IE6. The background image applied to the list item gets repeated randomly and generally messes up. Add this little gem to your head to fix the problem. Remember to change the id tag to your own.

jQuery code example to show content based on select option.

20 August, 2015   

Basic setup code for jQuery, linking to Google APIs for the jQuery library.

14 February, 2017   

jQuery doesn't really have an .hasAttr() function. You might assume that it does, but alas, it does not.

How to add jQuery and Snippet to your HTML document

04 January, 2014   

Example shows how to set Interval and set Timeout in jQuery

Code snippet to remove class after delay in jQuery.

12 January, 2011   

Browsers already have "back" buttons, so you'd better have a darn good reason for needing to put one on your page! This is totally obtrusive, but you could fix that by only appending this button through JavaScript.

jQuery example code for extract hyperlinks with specific href

To create the formatter paste this code into a new file and name it sfWidgetFormSchemaFormatterDefList.class.php. I saved it in /lib but it also makes sense to put it in /lib/form, depending on your personal preference.

11 April, 2013   

Pull external HTML code from a file right into your webpage

15 March, 2011   

This comes down to fixing a simple, yet annoying bug in IE’s capability of handling min-height. In essence, IE interprets height as min-height, so since IE wont implement the auto height, this snippet will fix all this for us.

An example code using jQuery Auto Image Scroller

jQuery example code to add image to browser cache

01 February, 2011   

Missing images will either just display nothing, or display a [ ? ] style box when their source cannot be found. Instead you may want to replace that with a "missing image" graphic that you are sure exists so there is better visual feedback that something is wrong. Or, you might want to hide it entirely. This is possible, because...

17 February, 2019   

Missing images will either just display nothing, or display a [ ? ] style box when their source cannot be found. Instead, you may want to replace that with a "missing image" graphic that you are sure exists so there is better visual feedback that something is wrong. Or, you might want to hide it entirely. This is possible because...

09 January, 2013   

Better way to handle Broken Image. Missing images will either just display nothing, or display a [ ? ] style box.