I am using ajax page loader plugin in wordpress . in every post page i m using
<a id="a_link" rel="nofollow" title="Print This Page" target="_blank" href="http://myurl.com/temp/?page_id=444&print=1">
<img class="WP-PrintIcon" style="border: 0px;" title="Print This Page" alt="Print This Page" src="http://myurl.com/temp/wp-content/plugins/wp-print/images/print.gif">
</a>
<a id="a_link" rel="nofollow" title="Print This Page" target="_blank" href="http://myurl.com/temp/?page_id=444&print=1">Print This Page</a>
But failed to open new tab. i also write code of JS in ajax page loader plugin’s script where content loaded.
to load this this script on ajax page loading.
jQuery('a').click(function (event) {
var id = jQuery(this).attr("id");
if(id == 'a_link'){ var href = jQuery(this).attr("href");
jQuery('#supersized-loader').css('display','none');
window.open(href);
}
});
You should change the design of your selector a bit to prevent it handling all links:
This should prevent the ajax page loader from running on links with the attribute
target="_blank". The code you added inside the loader is obsolete then.And: You can use an id only once. In your example you are using
a_linkat least twice.