Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('a').filter(function() {
- var title= $(this).attr('href');
- return this.hostname && this.hostname !== location.hostname;
- })
- .removeAttr('target')
- .attr('rel', 'external')
- .attr('title', title);
- $('a[rel="external"]').click( function() {
- window.open( $(this).attr('href') );
- return false;
- });
- $('a').each(function() {
- var href = $(this).attr('href');
- if(this.hostname && this.hostname !== location.hostname) {
- $(this).removeAttr('target')
- .attr('rel', 'external')
- .attr('title', href)
- .click(function() {
- window.open(href);
- return false;
- });
- }
- });
Add Comment
Please, Sign In to add comment