links and targeting
links and targeting
I have links in my <nav></nav> element that change content of another element with ID "article". which works for me. However, I sometimes have links in the nav area which are to external sites which I will need to load in a new window or browser tab. I am not sure as to go about this. Below is just the code for content that is local.
- (function() {
$('nav').on('click', 'a', function(event) {
var link = $(this).attr('href');
event.preventDefault();
$('#article').load(link);
});
})();