Igor Kitsula .NET Developer

A Web Programmer Reference

 
  1  2  3  4  

External links in new window using jQuery

Instead of using each time attribute target="_blank" for hyperlinks you can use jQuery.

$().ready(function () {
    $('a[href^=http]').addClass('external').attr('target', '_blank');
});

On loaded page jQuery selects all links on the page which begins with 'http', applies class "external" and adds attribute "target=_blank". Example any external link on this webpage. Is it not simple and nice? BTW, Strict HTML don’t allow using target=_blank attribute.

Favicon and robots.txt or What deployment begins from

Before the first deployment of new website you add Google Analytics tracking code on it and want to search engines start to indexing it. Of course you don't want to have any errors on first indexing. My experience shows that one's of important files that search engines trying to get are robots.txt and favicon.ico. First tells robots about possible restrictions, second - just an icon of website (which is shows in address bar of browser).

Read more...Read more...
  1  2  3  4