I have made a little script which purpose is to check for a part of a string inside a url and do substitute that string/url.
But i get a unexspected object error
What am i doing wrong?
jQuery(document).ready(function($) {
$('#menu a').language();
});
(function($) {
$.fn.language = function() {
$(this).each(function() {
if(this.attr("href").indexOf('about') > 1) {
this.attr("href","http://www.somelink.com");
}
});
}
})(jQuery);