I'm wanting to improve the way pages load my project.
In this project I'm using jquery
to load the page inside a box when I click on any of the links that I make available. In this script it uses the link that is in href
to load the page.
I would like (if possible) to 'make up' this link with onclick
. I want to make that if the person click directly on the link load the page in the box that should be loaded, but I also want if the person wants to open that link in a new tab it can open, only a different page. >
That is, in href
I want to use a link where if the person clicks to open the page in new tab will open for example a.php page, now if the person clicks directly on the link load the page b. php via jquery
inside the box.
The script that jquery
that I use to load the pages inside the box is:
$(document).ready(function(){
$('.postss a').live('click',function(){
$('#conteudo').load($(this).attr('href'));
return false;
});
});