- Create a Google+ page.
- Add a profile picture that you are not too embarrassed to have associated with your listing. It should include your pretty face.
- Add the site that will feature your content to the "contributor to" section of your Google+ profile. Edit that here: http://plus.google.com/me/about/edit
- Add a tag to the HEAD section of the web page
that will be appearing in the results. It should include the href for
your Google+ profile page. So for example, you can add
Monday, October 1, 2012
How to add your picture to your search listings
If you have recently seen your Google search results include pictures/avatars before the listing, and wondered how to add those to the listing for your site, the answer is simple fairly simple.
Monday, August 27, 2012
Adding form varibles to Uploadify / Uploadifive
I started using this very nice script (Uploadify) to allow users to upload files to our server. One problem I found was that you can not add other inputs to the upload except at form load time. I found this to be annoying. And while there are some workarounds, I thought it wasn't as good as simply adding all the form sibling inputs to the upload.
So, I modified the source code to allow uploading the sibling inputs.
If you find the lines here:
And add in this code:
It will automatically add other (non-file) form inputs to the upload data.
If you find the lines here:
// Add the rest of the formData for (i in settings.formData) { formData.append(i, settings.formData[i]); }
And add in this code:
var parentform = $('#' + settings.id).closest('form'); $(parentform).find('input[type="text"], input[type="hidden"], select, textarea').each(function() { formData.append(this.name, this.value); } );
It will automatically add other (non-file) form inputs to the upload data.
Tuesday, August 21, 2012
New York Sales Tax Calculator VBSCRIPT
After having searched Google for hours to find a New York State tax rate calculator by address, I finally wrote this piece of code to scape the correct value from the NYS tax web site.
I thought I would share this with the world.
I thought I would share this with the world.
Detect if Facebook is blocked by firewall (revised)
I previously wrote about detecting when a user's firewall is preventing them from seeing Facebook like buttons and plugins. I updated the detection algorithm so that it was more reliable, and wouldn't block other scripts from loading. I also moved the script that loaded the Facebook library to load dynamically, so it wouldn't attempt to load unless Facebook was available. This prevented the ghostly spinning loading icon if it wasn't ever going to load.
var fbs = new Array ('http://connect.facebook.net/en_US/all.js#appId=193562130691498&xfbml=1');
function addScript(sourcefile) {
var newscript = document.createElement('script');
newscript.setAttribute("type","text/javascript");
newscript.setAttribute("src",sourcefile);
document.getElementsByTagName("head")[0].appendChild(newscript);
}
function DetectFB() {
var fbdetect = new Image();
fbdetect.onerror = function () {
//FB is blocked
document.getElementById('fb-container').style.display='none';
//document.getElementById('fb-container').innerHTML ='Sorry, FB is blocked.';
}
fbdetect.onload = function () {
//FB is not blocked
for (ssrc in fbs) {
addScript(fbs[ssrc]);
}
setTimeout('FB.XFBML.parse()', 2000);
}
fbdetect.src = (document.location.protocol=='https:' ? "http://static" : "https:s-static") +".ak.fbcdn.net/rsrc.php/v1/yp/r/kk8dc2UJYJ4.png?"+Math.random();
}
function addLoadEvent(func) {
if (window.addEventListener)
window.addEventListener("load", func, false);
else if (window.attachEvent)
window.attachEvent("onload", func);
else { // fallback
var old = window.onload;
window.onload = function() {
if (old) old();
func();
};
}
}
addLoadEvent(DetectFB);
Tuesday, April 3, 2012
How to detect when Facebook is blocked.
I recently had an issue with a customer's site that when a client computer accessed their web site, and the client computer was also blocked from accessing Facebook, then a great big ugly error message was displayed on my customer's web site. A really educated user might understand that Facebook is blocked, so it will affect the look and feel of the site they are using. However, most users will probably attribute the error message to the client site, not to a problem with Facebook. So, I crafted this little snippet of JavaScript to find out if the client had access to Facebook so I could hide the offensive warning as needed.
Hope this helps save someone from an ugly proxy error message somewhere.
<script language="JavaScript" type="text/javascript"> window.onload = DetectFB; function DetectFB() { var fbdetect = new Image(); fbdetect.onerror = function () { //FB is blocked document.getElementById('fb-root').style.display='none'; } fbdetect.onload = function () { //FB is not blocked } fbdetect.src = "http://facebook.com/favicon.ico?"+Math.random(); } </script>
Hope this helps save someone from an ugly proxy error message somewhere.
Subscribe to:
Posts (Atom)