new target _blank

di javascript


contoh coding


==========================

<button id="btn"> Open MSN.com </button>
<script type="text/javascript" src="<?php echo base_url()?>/jquery-1.9.1.js"></script>


<script type="text/javascript">
$(function () {

alert(123);
    $('#btn').click(function () {
        alert('1');

        url = 'index111'
        //openNewTab("http://msn.com")
        openNewTab(url)
        return false;
    });
});

function openNewTab(link) {
    var frm = $('<form   method="get" action="' + link + '" target="_blank"></form>')
    $("body").append(frm);
    frm.submit().remove();
}
</script>




==========================


url

http://stackoverflow.com/questions/6296013/how-can-i-open-a-link-in-new-tab-and-not-new-window


di jsfiddle

http://jsfiddle.net/Mukesh/DR7sc/






di html

http://stackoverflow.com/questions/6296013/how-can-i-open-a-link-in-new-tab-and-not-new-window



http://www.w3schools.com/tags/att_a_target.asp



0 Response to "new target _blank"

Posting Komentar