2010-05-28 4 views

답변

0

당신은 동적으로 iframe을 만들려고 할 수 있음 :

<html> 
<head> 
    <script type="text/javascript"> 
    function insertFbButton() { 
    f = document.createElement("IFRAME"); 
    f.setAttribute(
    "src", 
    "http://www.facebook.com/plugins/like.php?" 
    + window.location.href 
    + "&amp;layout=button_count&amp;show_faces=true&amp;width=450" 
    + "&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" 
    ); 
    f.style.width = 450+"px"; 
    f.style.height = 210+"px"; 
    document.body.appendChild(f); 
    } 
    </script> 
</head> 
<body> 
    <p>Content</p> 
    <script>insertFbButton();</script> 
    <p>Content</p> 
</body> 
</html> 
0

사용 window.location.href 또는 window.location.pathname 표현하면 "이 HTML은"무엇 전체 URL

관련 문제