JavaScript Hide status bar value from href url when mouse hover a link

This is the link that I have:

target='_blank' href='" . $ajax_like_link . "' data-task='like' data-post_id='" . $post_id . "' data-nonce='" . $nonce . "'>";

And I want to replace the displayed link value from status and set to javascript:void(0).

How can I accomplish this?

Answer:1

Try this:

<a target='_blank' href="javascript:void(0)" onclick="location.target='_blank' href='" . $ajax_like_link . "'">Link</a>
Answer:2

you can do it by calling javascript function instead of link in href:

   <a target='_blank' href='javascript:void(0)' onclick='gotoLink(\"". $ajax_like_link ."\")' .......>link</a>
    <script>
    function gotoLink(url) {
        window.location = url;
    }
    </script>
Answer:3

You can set the status with window.status='' but most browsers will block attempts to change the status line by default for security reasons

<a target='_blank' href="link" onmouseover="window.status='javascript:void(0)';" onmouseout="window.status='';">link here</a>

So a better way is to

<a target='_blank' href="javascript:void(0)" onclick="location.target='_blank' href='" . $ajax_like_link . "'">Link</a>
Answer:4

I have a for loop in php that adds a number of checkboxes on my page that look like this <input type="checkbox" name="checkbox[]"> I want to use javascript to check which is checked and add ...

I have a for loop in php that adds a number of checkboxes on my page that look like this <input type="checkbox" name="checkbox[]"> I want to use javascript to check which is checked and add ...

  1. remove some values from array php
  2. find some values in array

I wanted Two Google Maps API in single html file. SO I have done like following. But it is not working. Please help me by guiding why I cant and where I am mistaking? Thanks in advance. <html&...

I wanted Two Google Maps API in single html file. SO I have done like following. But it is not working. Please help me by guiding why I cant and where I am mistaking? Thanks in advance. <html&...

  1. longest possible google maps route
  2. longest possible drive google maps

I have to modify some code and the previous developer left this comment: color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information On the page there is a color picker that let's the ...

I have to modify some code and the previous developer left this comment: color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information On the page there is a color picker that let's the ...

<script type="text/javascript" src="/js/jquery1.8.3.js"></script> <script> $(document).ready(function(){ $("li").has("ul").bind("click",function(e){ console.log($(...

<script type="text/javascript" src="/js/jquery1.8.3.js"></script> <script> $(document).ready(function(){ $("li").has("ul").bind("click",function(e){ console.log($(...