Revision: 52398
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 21, 2011 20:48 by odenijs
Initial Code
var linkRewriter = function(old_domain, new_domain) { $('a[href*="' + old_domain + '"]').each(function() { if ($(this).attr('href') == old_domain ) { $(this).attr('href', $(this).attr('href').replace(old_domain, new_domain)); } }); }; linkRewriter('www.olddomain.com', 'www.newdomain.com');
Initial URL
Initial Description
Initial Title
Replace domain on all href attributes
Initial Tags
javascript, replace, jquery
Initial Language
JavaScript