Created
March 13, 2014 03:58
-
-
Save 0x4a/9521688 to your computer and use it in GitHub Desktop.
check if page title ends in string, append string when not - #jQuery #work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
var title_shop = " | Samenhaus Müller"; | |
var title_page = encodeURI($(document).attr('title')); | |
var regex = new RegExp(encodeURI(title_shop) + "$"); | |
if (title_page.match(regex) == null) | |
{ | |
$(document).attr('title', decodeURI(title_page) + title_shop); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment