クライアントは最近、自分の Web サイトでソーシャル メディアへのリンクをリクエストしました。Facebookは、これまでで初めての試みです。私のクライアントは Facebook ページを持っていません。
私のコード:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function renderFbLike() {
var parent = document.getElementById('fblikediv');
var child = document.getElementById('fblikeimg');
parent.removeChild(child);
//this really works...sort of
var html2 = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http://www.jplandman.co.za&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=60&appId=258346014244946\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:40px;\" allowTransparency=\"true\"></iframe>";
document.getElementById('fblikediv').innerHTML = html2;
}
</script>
</head>
<body>
<br />
<br />
<br />
<div id="fblikediv">
<img src="images/fb-like-button.png" id="fblikeimg" onmouseover="return renderFbLike();"></div>
<p />
</body>
</html>
スクリーンショット:
私の質問: 「JPLandman」というリンクは、存在しない Facebook ページにリンクしています。これを防ぐ方法はありますか?可能な回避策は何ですか?