Home Ask Login Register

Developers Planet

Your answer is one click away!

Mukhlis Saputro February 2016

Open New Tab Link Facebook From Localhost When Button Onclick

I have button link in my web app. I run it from localhost. Source code like this, And I think it normally (No error):

<a href="facebook.com" style="text-decoration:none;" target="_blank"><input type="button" value="Pembuatan Akun Facebook" class="tombol" style="width:200px !important;"></a>

What I want, when I Click That Button, Browser will open new tab, and connect to facebook page. But what I get, it link to url:

http://localhost/dewata/facebook.com (My web app in folder dewata).

enter image description here

Not facebook.com.

Any idea what happens?


Vasfed February 2016

You need full href with protocol for external links, otherwise browser expect a file named 'facebook.com' on your site.

<a href="http://Facebook.com">...

Post Status

Asked in February 2016
Viewed 2,532 times
Voted 11
Answered 1 times


Leave an answer

Quote of the day: live life