Birdhouse Websites and Designs

The Goal:
When a user navigates away from the browser window they’re on (ie: your website to someone else’s), this code snippet will change the text to something catchy that will bring them back.


  • jQuery / JS




Add this to your custom scripts. Make sure you have jQuery installed.

[cc lang=”javascript”]
// Browser Navigate Away Code
$(function() {
// Get page title
var pageTitle = $(“head title”).text();


// Change page title on blur
$(window).blur(function() {
$(“title”).text(‘Not So Fast!’);

// Change page title back on focus
$(window).focus(function() {

Share This