Articles
PHP Date Parameters
format character |
Description | Example returned values |
---|---|---|
Day | — | — |
d | Day of the month, 2 digits with leading zeros | 01 to 31 |
D | A textual representation of a day, three letters | Mon through Sun |
j | Day of the month without |
Inputs That Remember Original Value
var origValue = [];
$('input.remember').each ( function (currentIndex)
{
origValue.push ( $(this).val () );
$(this).focus ( function ()
{
$(this).removeClass("unfocused");
var defaultText = $(this).val();
if ( $(this).val () == origValue [ currentIndex ] )
{
$(this).val('');
}
$(this).blur(function()
{
var
… CSS Font Families
Sans-Serif
Arial, sans-serif;
Helvetica, sans-serif;
Gill Sans, sans-serif;
Lucida, sans-serif;
Helvetica Narrow, sans-serif;
sans-serif;
Serif
Times, serif;
Times New Roman, serif;
Palatino, serif;
Bookman, serif;
New Century Schoolbook, serif;
serif;
Monospace
Andale Mono, monospace;
Courier New, monospace;
Courier, monospace;
Lucidatypewriter, …
All Stylesheet Media Types
<link rel="stylesheet" type="text/css" href="print.css" media="print">
all | Used for all media type devices |
aural | Used for speech and sound synthesizers |
braille | Used for braille tactile feedback devices |
embossed | Used for paged braille printers |
handheld | Used for small or handheld devices |
Accessibility/SEO Friendly CSS Hiding
.screen-reader-text {
position: absolute;
top: -9999px;
left: -9999px;
}
This class can remove an item from the page, taking it out of flow and doesn’t cause overflow scrolling.
It’s better than display: none;
or even visibility: hidden;
when the goal …
Snippet Search Results
var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 948; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse";
google.load("elements", "1", {packages: "transliteration"});
…
Display FeedBurner Feed Count
<?php
//get cool feedburner count
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=your feedburner id";
//Initialize the Curl session
$ch = curl_init();
//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
… Natural Sort Using Post meta_key
@@ -2033,6 +2033,7 @@
if ( !empty($q['meta_key']) ) {
$allowed_keys[] = $q['meta_key'];
$allowed_keys[] = 'meta_value';
+ $allowed_keys[] = 'meta_value_num';
}
$q['orderby'] = urldecode($q['orderby']);
$q['orderby'] = addslashes_gpc($q['orderby']);
@@ -2056,6 +2057,9 @@
case 'meta_value':
$orderby = "$wpdb->postmeta.meta_value";
break;
+ case 'meta_value_num':
+
… Detect Javascript On/Off, With Notification
<script type="text/javascript">
document.write("Welcome, you have Javascript on.")
</script>
<noscript>JavaScript is off. Please enable to view full site.</noscript>
If JavaScript is on the user gets a welcome message. If off, the user is instructed to turn it on.…
Different Stylesheet Pending the Time of Day
<script>
<!--
function getStylesheet() {
var currentTime = new Date().getHours();
if (0 <= currentTime&¤tTime < 5) {
document.write("<link rel='stylesheet' href='night.css' type='text/css'>");
}
if (5 <= currentTime&¤tTime < 11) {
document.write("<link rel='stylesheet' href='morning.css' type='text/css'>");
}
if (11 <= currentTime&¤tTime < 16)
…