mrkeck Sharing the Love

13Jan/150

Make buttons act like buttons

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

$('button').attr('type','button');
Filed under: HTML, jquery No Comments
13Apr/140

Cross-Browser Testing

I'm using a Mac so no IE to play with, so it got me looking around.

BrowserStack.com 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 BrowserShots.com (which looks cool too, takes screenshots based on different browsers) because I needed to login to the page I was testing.

13Apr/141

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
12Jun/130

Select Box of US States

Works well with Select2

<select id="location" name="location" placeholder="Location">
	<option></option>
	<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>
</select>
Filed under: HTML No Comments
9Mar/130

PHP HTML img src BLOB

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

HTML Comment Convention

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

Basic open/close tags with some css selecting

Filed under: Convention, HTML No Comments
7Dec/120

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.

1
2
3
4
<!-- 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
26May/110

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
24Mar/110

Custom Ajax Loading Gifs

http://ajaxload.info/

1Feb/110

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