Make Your Own URL LIKE BITLY IN HTML



How to Make Your Own URL Shortener with My Backlink, JavaScript - In this post I tried to create its own URL shortener using JavaScript code. If before me and you used to use bit.ly, goo.gl and the like, now I am and you will create its own URL shortener. The script that I can share is also called a URL Redirect. URL Redirection or transfer permalink actually been facilitated by a blogger, only limited on our blog, can not lead to other blogs.

Facebook or http://hackerprime.com

To make it, save the code above </head> .

Example One

<script language='javascript'>
//<![CDATA[
var key = window.location.href.split("go/")[1].replace("/","")
var urls={
'fb':'https://www.facebook.com/Hackerprime,
'gplus':"https://plus.google.com/+xxxxxx",
'twitter':"https://twitter.com/xxxxxxx",
'blabla':"http://xxxxx.com/",
'blabla':"http://blabla.net",
'blabla':"http://www.blabla.com",
'blabla':"https://www.blabla.us" /* the latter without coma */
}
if(key){
if(urls[key]){
window.location.href=urls[key]
}else{
document.write("'"+key+"' not found :(");
}
}
//]]>
</script>

Example Two

<script language='javascript'>
//<![CDATA[
var key = window.location.href.split("go/")[1].replace("/","")
var urls={
'fb':'https://www.facebook.com/Hackerprime007,
'gplus':"https://plus.google.com/+xxxxxx",
'twitter':"https://twitter.com/xxxxxxx",
'blabla':"http://www.blabla.com",
'blabla':"https://www.blabla.us" /* the latter without coma */
}
if(key){
if(urls[key]){
window.location.href=urls[key]
}else{
document.write("'"+key+"' not found :(");
}
}
//]]>
</script>



Example Three

<script language='javascript'>
//<![CDATA[
var key = window.location.href.split("go/")[1].replace("/","")
var urls={
'fb':'https://www.facebook.com/Hackerprime007,
'gplus':"https://plus.google.com/+xxxxxx",
'twitter':"https://twitter.com/xxxxxxx" /* the latter without coma */
}
if(key){
if(urls[key]){
window.location.href=urls[key]
}else{ document.write("'"+key+"' not found :(");
}
}
//]]>
</script>

Comments

Popular posts from this blog

Youtube Video Presentation

Create Quality and ClickBait Thumbnail

How to hack wifi using backtrack