You need to use a Key for Google's AJAX search. This key happens to be per domain sub folder. Since you can get to my site via thisoldcode.net or thisoldcode.microfisch.com Googles search would throw an error depending which entry point you enter. I don't seem to have the ability to forward all thisoldcode.microfisch.com traffic to thisoldcode.net ( I should but the godaddy settings are not taking). In the search api documentation they load the search via a js file with a hard coded key.
<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=This Old Code Key" type="text/javascript"></script>
so I added a simple JavaScript function to dynamically write this include based on the website entry point.
function SetGoogleSearchKey() { var DomainKey = 'This Old Code Key'; if( document.domain == "thisoldcode.microfisch.com" ) DomainKey = 'Microfisch Key'; var ScriptTag = 'script';//trick the bloody browser. document.write('<' + ScriptTag + ' src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=' + DomainKey + '" type="text/javascript"></' + ScriptTag + '>'); }
It would have been nice if Google's JS script file did not display an alert when it cannot load do to the key error. I would have simply allowed thisoldcode.microfisch.com to have the search. after all I don't really need two. But its cool.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u
Page rendered at Friday, November 21, 2008 3:14:32 AM (Pacific Standard Time, UTC-08:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.