October 7th, 2008
The problem: when a user clicked the back button, the form stayed selected, but it shouldn’t have.
The solution:
body onload…
function resetForm() {
document.getElementById(”myselect”).value = document.getElementById(”myselect”).selectedIndex=0;
}
Posted in Uncategorized | No Comments »
September 2nd, 2008
A couple weeks ago, I was approached to help out a site called Sunday Streets. I didn’t know much about it, but offered to help out.
This was the original design.
This is the new design I made:
sundaystreetssf.com.
Also, it turns out the site has been advertised *everywhere* (bus shelters, nextbus, flyers) and is getting 4K hits per day. It’s been a fun project, simple HTML and they are grateful for everything.
Posted in Uncategorized | No Comments »
August 20th, 2008
This is a fantastic article on SEO and the importance of elements on the page.
The short of it:
1. title tag
2. body text
3. Relationship of Body Text Content to Keywords
4. h1
5. domain name
6. URL
7. h2, h3, etc.
8. alt tags and image titles
9. strong tags
10. meta description
11. meta keywords
Posted in Uncategorized | No Comments »
August 5th, 2008
A client was confused about how SEO works, so I made a very simple diagram about the basics of SEO (for Google, really).
Posted in Uncategorized | No Comments »
July 21st, 2008
This is one of the strangest cross-browser things I’ve come across, including IE bugs…
Picture this:
-A div that is hidden until moused over (abs position, z-index > 1)
-Onmouseout, it hides itself
-When it is displayed, it has an overflow:scroll
In Safari, when you would scroll and try to click any of the items in the list, it would scroll back to the beginning!
The fix is to make the div visibility:hidden, not display:none. So, since this would leave the scrollbar with no div in IE/FF, I did this in PHP:
if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']),strtolower(”Safari”))) {
$visibility = “visibility:hidden”;
} else {
$visibility = “display:none”;
}
Then just printed out the var in the JavaScript.
Posted in Uncategorized | No Comments »
July 9th, 2008
You can string together string functions like replace into one line:
lc_make = full_make.replace(”%20″,”_”).replace(”%2520″,”_”).replace(” “,”_”);
Posted in Uncategorized | 1 Comment »
June 30th, 2008
It’s been a while since I last wrote a command line PHP script, but I needed one today to parse through a database dump csv file. This is how to get the ID, which was my first column:
if($file= file_get_contents(’myfile.csv’)) {
$line = split(”\n”,$file);
foreach($line as $lines) {
$data = split(”;”, $lines);
echo $data[0] . “\n”;
}
} else {
echo “couldn’t open”;
}
Posted in Uncategorized | No Comments »
February 17th, 2008
This is an informational post…to clear cache on:
- Internet Explorer 6: choose Tools->Internet Options, Delete Files (screen shot)
- Internet Explorer 7: choose Tools->Internet Options, Delete->Delete Files (screen shot)
- Firefox: (Mac->Firefox | PC->Tools) ->Preferences, Advanced, Network->Clear now (screen shot)
- Safari: Safari->Empty cache (screen shot)
Posted in Uncategorized | No Comments »
January 29th, 2008
I got the coolest thing ever.
After talking about how I wanted copy and paste buttons on the right because I’m a lefty on the mouse, I finally got it! It’s called the Optimus Mini Three. <– pasted using the middle button.
Mine is so pretty too…I made the buttons be flowers - well, and a firefox logo until I learn that I made the shift + top button be “open new tab”.
Posted in Uncategorized | 1 Comment »
January 11th, 2008
onchange doesn’t work consistently in IE, but if you change it to onclick, it works fine in both IE and FF.
Posted in Uncategorized | No Comments »