mrkeck Sharing the Love


Make buttons act like buttons

By default, buttons are submits, so this should make them act actually like buttons

Filed under: HTML, jquery No Comments

Cross-Browser Testing

I'm using a Mac so no IE to play with, so it got me looking around. opens a dynamic cloud computer with whatever OS, Browser, and Resolution you would like. The remote Browser has dev tools, even Firebug Lite in IE.

You can take screenshots if you want to as well.

I used this instead of (which looks cool too, takes screenshots based on different browsers) because I needed to login to the page I was testing.


jQuery attr vs prop for Checkbox

attr is iffy

$('.checkbox').attr('checked', true);      //Doesn't work
$('.checkbox').attr('checked', 'checked'); //Sometimes works
$('.checkbox').attr('checked', false);     //Works

but prop works every time

$('.checkbox').prop('checked', true);  //Works
$('.checkbox').prop('checked', false); //Works
Filed under: HTML, jquery 1 Comment

Select Box of US States

Works well with Select2

<select id="location" name="location" placeholder="Location">
	<option value="AL">AL - Alabama</option>
	<option value="AK">AK - Alaska</option>
	<option value="AZ">AZ - Arizona</option>
	<option value="AR">AR - Arkansas</option>
	<option value="CA">CA - California</option>
	<option value="CO">CO - Colorado</option>
	<option value="CT">CT - Connecticut</option>
	<option value="DC">DC - Washington, DC</option>
	<option value="DE">DE - Delaware</option>
	<option value="FL">FL - Florida</option>
	<option value="GA">GA - Georgia</option>
	<option value="HI">HI - Hawaii</option>
	<option value="ID">ID - Idaho</option>
	<option value="IL">IL - Illinois</option>
	<option value="IN">IN - Indiana</option>
	<option value="IA">IA - Iowa</option>
	<option value="KS">KS - Kansas</option>
	<option value="KY">KY - Kentucky</option>
	<option value="LA">LA - Louisiana</option>
	<option value="ME">ME - Maine</option>
	<option value="MD">MD - Maryland</option>
	<option value="MA">MA - Massachusetts</option>
	<option value="MI">MI - Michigan</option>
	<option value="MN">MN - Minnesota</option>
	<option value="MS">MS - Mississippi</option>
	<option value="MO">MO - Missouri</option>
	<option value="MT">MT - Montana</option>
	<option value="NE">NE - Nebraska</option>
	<option value="NV">NV - Nevada</option>
	<option value="NH">NH - New Hampshire</option>
	<option value="NJ">NJ - New Jersey</option>
	<option value="NM">NM - New Mexico</option>
	<option value="NY">NY - New York</option>
	<option value="NC">NC - North Carolina</option>
	<option value="ND">ND - North Dakota</option>
	<option value="OH">OH - Ohio</option>
	<option value="OK">OK - Oklahoma</option>
	<option value="OR">OR - Oregon</option>
	<option value="PA">PA - Pennsylvania</option>
	<option value="RI">RI - Rhode Island</option>
	<option value="SC">SC - South Carolina</option>
	<option value="SD">SD - South Dakota</option>
	<option value="TN">TN - Tennessee</option>
	<option value="TX">TX - Texas</option>
	<option value="UT">UT - Utah</option>
	<option value="VT">VT - Vermont</option>
	<option value="VA">VA - Virginia</option>
	<option value="WA">WA - Washington</option>
	<option value="WV">WV - West Virginia</option>
	<option value="WI">WI - Wisconsin</option>
	<option value="WY">WY - Wyoming</option>
Filed under: HTML No Comments


echo "<img src='data:image/jpeg;base64, " . base64_encode(your BLOB) . "'>"
Filed under: HTML, PHP No Comments

HTML Comment Convention

<!-- <Amazing Segment of Code> -->
<div id='amazing'>
     <span class='segment'>
     </span><!-- </.segment> -->
</div><!-- </#amazing> -->
<!-- </Amazing Segment of Code> -->

Basic open/close tags with some css selecting

Filed under: Convention, HTML No Comments

Stop HTML Button from Submitting

By default the HTML button has type='submit' if you set type='button' it will act like a button and not do anything until you give it something to do.

<!-- this will submit the form -->
<button>Clicky 1</button>
<!-- this will do nothing -->
<button type='button'>Clicky 2</button>

It was driving me crazy...all good now

Filed under: HTML No Comments

htaccess in WAMPServer

In the htaccess, I have "<IfModule mod_deflate.c>" so I just need to make sure mod_deflate.c is Loaded in the httpd.conf that Apache is using. Once I uncommented all the Loads that I needed my htaccess worked great!

Side note: I am using the htaccess from HTML 5 Broilerplate

Filed under: HTML, PHP, wamp, web No Comments

Custom Ajax Loading Gifs


Disabled and Readonly Inputs

Disabled and Readonly input fields both do not allow edits. However, Readonly fields post their values and will receive focus.

Filed under: HTML No Comments