Saturday 12 September 2015

Make Your Own URL Shortener with JavaScript In Blogger blog


Now a days people are using different URL shortners to shorten there long URL's, today am going to share a unique post which will surely inspire you the most. You can now make a url short using your own blog.I hope you will surely like this tutorial if you face any kind of problem then kindly leave a comment below i will surely help you as soon as possible.
You can check out the shorten URL demo by clicking the below link



To make it , save the code above </head>
<script language='javascript'>
//<![CDATA[
var key = window.location.href.split("go/")[1].replace("/","")
var urls={
    'fb':'https://www.facebook.com/nomiidesign',
    'gplus':"https://plus.google.com/+numairking",
    'twitter':"https://twitter.com/numairgames" /*the latter without coma */
}
if(key){
    if(urls[key]){
        window.location.href=urls[key]
    }else{
        document.write("'"+key+"' not found :(");
    }
}
//]]>
</script>
Change / add links as you wish.
To understand it , when I wrote 'fb':'https : //www.facebook.com/nomiidesign' means , when accessing http://nomiidesign.blogspot.com/go/fb will lead to https://www.facebook.com/nomiidesign.

Hope it is useful ..

No comments:

Post a Comment