Blog Archives

Bootstrap Tab linking

If you use Bootstrap (v3.x) you would see that clicking on a tab does add anything to the url so if you were to refresh, you wouldn’t go back to the tab you are on.  The post below says to

Tagged with: , ,
Posted in Coding

Javascript defaultValue

For some reason I have never needed to use the defautlValue property up until today.  I was pleased to find javascript can access the original input value so tracking changes in a form is a bit easier.  However, the defaultValue

Tagged with: ,
Posted in Coding

Fancybox not working after second click

Problem Setting up fancybox 1.3.4 with inline content doesn’t work when clicking on the link twice. Solution The problem I think is with the upgraded version of jQuery.  If using jQuery 1.4 like the example, it should work fine.  But

Tagged with: ,
Posted in Coding

IE Doesn’t see padding on hover

Problem Internet Explorer 8 (I no longer even look at IE 7) seems to not be able to see the padding on an anchor tag within a ul > li > a structure.   Using jQuery I have a hover

Tagged with: , , ,
Posted in Coding

jQuery – When to use return false or preventDefault

Ran into a great article that explains the differences between return false, preventDefault and stopPropagation.  Here’s a summary: return false does both preventDefault and stopProgagation preventDefault just stops the browser default event. stopPropagation stops bubbling. In most cases you would

Tagged with: ,
Posted in Coding

WordPress Widget Image Field

I found a great utility plugin to help with adding a Image picker field to a widget.  Basically you install and activate this plugin and you make your own widget and utilize the image field easily. The only problem I

Tagged with: , ,
Posted in Coding

Passing parameters to setTimeout in a loop

Problem I know to pass a parameter to a setTimeout function you would use javascript’s “closure” to get it to work: setTimeout(function(){alert(someParameter)}, 1000); However if you are setting someParameter in a loop, setTimeout will always alert the last value set

Tagged with:
Posted in Coding

jQuery add table row

Problem How do you add a table row using jQuery?  A table has so many different elements in it that things might get screwy.   Solution There is no one statement-to-use-on-all, but the below line is a pretty general answer

Tagged with: ,
Posted in Coding

Javascript Files with PHP

Below is a great article on getting your PHP to print out a javascript file and including it like any other javascript file.   You basically just have to name the file something like “something.js.php” so that PHP knows to

Tagged with: ,
Posted in Coding

Caching Issue

Problem: Changed a javascript file, but the browser still detects it.  Take out the javascript file, and the page still runs fine as if it is there.  This is occurring in IE. Solution: Hit f5 a million times.  Clear the

Tagged with: ,
Posted in Coding