JAVASCRIPT shorten link javascript - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution

shorten link using javascript


 115

Show ResultJAVASCRIPT


2

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<script>

var url = "https://net-raft.com/Questions/2615/delete-a-specific-row-in-a-html-table-using-javascript/2615";
var arr = url.split("/");
var result = arr[0] + "//" + arr[2];
var text = "";

function GenUniqueLink(length) {

var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}

return "<a href='" + url + "' id='anchor' onmouseover='display();' onmouseout='display1();' onclick='display2();'>" + result + "/" + text + "</a>";

}

function display() {

var link = document.getElementById("anchor");
var link1 = result + "/" + text;
link.href = link1;
return false;

}

function display1() {

var link = document.getElementById("anchor");
var link1 = url;
link.href = link1;
return false;
}

function display2() {

var link = document.getElementById("anchor");
var link1 = url;
link.href = link1;
return false;

}

document.write(GenUniqueLink(16));

</script>

</body>
</html>


By     Created   
The power of the user (%)
11%



The most helpful JAVASCRIPT solutions

How to get client machine name or computer name with javascript ?How to get client machine name or computer name with javascript ?JAVASCRIPT

Click to see more ...

  4.8K     383

get client hostname javascriptget client hostname javascriptJAVASCRIPT

Click to see more ...

  2.6K     254

detect ie javascriptdetect ie javascriptJAVASCRIPT

Click to see more ...

  1.6K     159

Create fireworks using javascriptCreate fireworks using javascriptJAVASCRIPT

Click to see more ...

  1.5K     113

create 3d barrel using javascriptcreate 3d barrel using javascriptJAVASCRIPT

Click to see more ...

  1.4K     99

get ip address javascriptget ip address javascriptJAVASCRIPT

Click to see more ...

  782     74

how to create foreach class using javascript ?how to create foreach class using javascript ?JAVASCRIPT

Click to see more ...

  769     73

create qr code javascriptcreate qr code javascriptJAVASCRIPT

Click to see more ...

  543     71

how to create the connect to a database with ADODB using javascript ?how to create the connect to a database with ADODB using javascript ?JAVASCRIPT

Click to see more ...

  488     59

get filename using javascript get filename using javascript JAVASCRIPT

Click to see more ...

  478     56