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


 471

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 ...

  5.6K     385

get client hostname javascriptget client hostname javascriptJAVASCRIPT

Click to see more ...

  3.3K     264

detect ie javascriptdetect ie javascriptJAVASCRIPT

Click to see more ...

  2K     170

Create fireworks using javascriptCreate fireworks using javascriptJAVASCRIPT

Click to see more ...

  1.7K     139

create 3d barrel using javascriptcreate 3d barrel using javascriptJAVASCRIPT

Click to see more ...

  1.6K     99

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

Click to see more ...

  1.1K     83

get ip address javascriptget ip address javascriptJAVASCRIPT

Click to see more ...

  852     76

create qr code javascriptcreate qr code javascriptJAVASCRIPT

Click to see more ...

  608     71

get filename using javascript get filename using javascript JAVASCRIPT

Click to see more ...

  582     61

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 ...

  565     59