Attach a click() event to the FaceBook 'Like' button?

前端 未结 5 1492
既然无缘
既然无缘 2020-12-25 14:27

I\'d like to do something on the page when a user clicks \'Like\'.

I thought something simple like the following would work:



        
5条回答
  •  暖寄归人
    2020-12-25 14:52

    You cannot use JavaScript to access elements within an iframe that does not belong to the current URL, as I guess the domain you're using is not facebook.com you won't be able to attach an event to the like button in this way.

提交回复
热议问题