Open link in a new window in XHTML 1.0 Strict June 24, 2009 No Comments
As you may notice using target=”_blank” breaks XHTML 1.0 Stric validation. And here you are a solution with jQuery:
Add rel=”external” for links that you want to be opened in a new window
Include the following jQuery script:
$(function() {
$("a[rel*='external']").click(function() {
window.open($(this).attr(‘href’), ‘external’, ”);
});
});
But I agree that it’s annoying when link is opening in new [...]
My name is Alexander Kleshchevnikov. I have been working as a professinal web application developer since 2002. I believe in simple intelligence from server technologies to front-end development. Now I run my own web development consulting company in Ukraine. You can find