Tips, Tricks and Information for the Modern Technologist

Category: JavaScript


Using Google Analytics Or Other Javascript With Smarty Template Engine

Posted 19th October in Code Samples, JavaScript, Webdesign. No Comments

On a website I was working on recently I added the Google Analytics tracking code to the footer of a Smarty template, like this: footer.tpl: 1234567891011121314151617<script type="text/javascript">   var _gaq = _gaq || [];   _gaq.push(['_setAccount', 'UA-XXXXX-XX']);   _gaq.push(['_trackPageview']);   (function() {     var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;   [...]



Secure Your Google Apps (Gmail, GDocs, GCal, etc)

Posted 10th August in Configurations, JavaScript, Security, Windows. Comments Off

If you are a Google user – meaning Gmail, Google Docs, Google Calendar, Google Reader, etc – then you should know that by default, once you log in your sessions are typically not encrypted between your browser and the Google servers. For some more technical information on this, check out dmiessler’s post on the subject. [...]


Closing a Firefox Window with Javascript

Posted 14th September in Code Samples, JavaScript. 46 Comments

I recently had a problem where I was opening a browser window from an e-mail client. After taking a survey, I wanted a button to close this same window. In IE, it was fine to simply use window.close(); to close the window. However, Firefox, the evil genius that it is, will not let you do [...]


Greasemonkey + Duggmirror Script = Awesome

Posted 13th September in JavaScript, Linux, System Administration, Windows. Comments Off

Don’t you hate it when you try to visit a digg story and the site has been dugg? Use the greasemonkey firefox plugin and this duggmirror greasemoney script to add three links to each digg entry – the duggmirror archive, Coral NYU Mirror, and the Google Cache of the page, all with a nice graphical [...]