首页 \ 问答 \ Facebook就像按钮没有发布到Facebook(Facebook like button not posting to facebook)

Facebook就像按钮没有发布到Facebook(Facebook like button not posting to facebook)

我在这个网站的顶部有一个类似Facebook的按钮: 点击这里

当您单击该按钮时,您成功地喜欢该页面,但“发布到Facebook”功能不起作用。 模态窗口就在那里。

这工作正常,直到我前几天对网站做了一些更改,但即使我删除了这些更改,“post to facebook”问题仍然存在。

我试过调试页面,但无济于事。 我想也许facebook一直在惩罚网站上那么多搞乱类似按钮,但我不确定这是否甚至是facebook的功能。

任何帮助,将不胜感激。 谢谢。


I have a facebook like button at the top of this website: Click here

When you click on the button, you successfully like the page, but the "post to facebook" feature doesn't work. The modal window just stays there.

This worked fine until I made some changes to the site the other day, but even after I removed those changes, the "post to facebook" problem persisted.

I've tried debugging the page, but to no avail. I thought perhaps facebook had been punishing the website for messing with the like button so much, but I'm not sure if that's even something facebook does.

Any help would be appreciated. Thanks.


原文:https://stackoverflow.com/questions/13627690
更新时间:2024-03-14 16:03

最满意答案

问题可能是字符编码。 您应该使用JavaScript中的方法encode_utf8(stringValue)和.NET中的new UTF8Encoding.getBytes(String value) ,以确保字符编码匹配。 请注意,现代加密基于字节,而不是字符串或字符。 使用System.Buffer.BlockCopy()来编码字符真的是不好的做法。


The problem is probably the character encoding. You should use for instance the method encode_utf8(stringValue) in JavaScript and new UTF8Encoding.getBytes(String value) in .NET, to make sure that the character encodings match. Note that modern cryptography is based on bytes, not on strings or characters. Using System.Buffer.BlockCopy() to encode characters is really bad practice.

相关问答

更多
  • PHP和JS实现之间的区别在于,PHP将UTF-8字符串作为8位字符处理,而在JS中,每个字符串都由Unicode表示。 请尝试一下: hash_hmac("sha1", 'ą', "1492343027") == hex_hmac_sha1("1492343027",'\xC4\x85') 的jsfiddle UTF 8 hex来自 - http://www.charbase.com/0105-unicode-latin-small-letter-a-with-ogonek JS hex_hmac_sha ...
  • 你告诉jsSHA库输入是十六进制字符串: var hmacObj = new jsSHA(time, "HEX"); 但是你在hash_hmac()调用之前/之内没有做任何与PHP相同的事情。 这意味着jsSHA获取原始二进制数据,而PHP的hash_hmac()获取文字字符串“0000000002f3e3c9”。 当然,这不会产生相同的结果。 将hex2bin()应用于$time然后将其传递给hash_hmac() 。 You tell that jsSHA library that the input ...
  • 这就是Python的hmac模块的用途,不要直接使用MD5功能。 # Right import hmac # Note that hmac.new defaults to using MD5 hmac.new("password", "message").hexdigest() # 'f37438341e3d22aa11b4b2e838120dcf' # Wrong from hashlib import md5 md5("message"+"password").hexdigest() # 'd0647 ...
  • 所以你正在消化JavaScript中没有内容的hmac? 那是什么目的? 您通常希望使用hmac进行消息身份验证,但如果您没有消息,则不需要进行身份验证。 你能更具体地说明为什么你试图使用没有内容的hmac? 通常在JS中你会做这样的事情: var crypto = require('crypto'); var myHash = function(seed){ var hash = crypto.createHmac('sha256', seed).update('my message').dige ...
  • 您的问题是由您的密钥造成的。 在C#中,您传入一个16字节的数组作为键。 在CryptoJS中,你传入一个CryptoJS正在解释为密码的字符串,因此它将生成一个完全不同的密钥。 编辑 :这是如何在JavaScript中获取正确的密钥: 如果您将16字节密钥转换为Base64,则可以在javascript中执行以下操作。 它将生成一个WordArray作为键,并使用该键生成您的哈希。 var keyBase64 = "eFY0EiMBZ0UBI0VniRI0Vg=="; var key = CryptoJS ...
  • 问题是你的PHP和JavaScript代码都这样做: Base64(Hex(Hmac(key, msg))) 。 你真的不需要双重编码。 在PHP中,您可以简单地请求raw_encoding而不是十六进制: $macSum = hash_hmac('sha256', $data, 'secret', true); 并且在CryptoJS中,您必须直接编码到Base64,而不是编码为十六进制,然后使用btoa() : var data64 = mac.toString(CryptoJS.enc.Base64) ...
  • 您的方法必须按原样返回正确的结果。 请参阅http://oauth.net/core/1.0/#signing_process : HMAC-SHA1签名方法使用[RFC2104]中定义的HMAC-SHA1签名算法,其中签名基本字符串是文本, key是消费者秘密和令牌秘密的连接值(每个参数编码首先编码) ,即使为空,也用'&'字符(ASCII码38)分隔 。 在这种情况下,关键应该是"efgh&mnop" 。 Your method must returns correct result as is. Se ...
  • 问题可能是字符编码。 您应该使用JavaScript中的方法encode_utf8(stringValue)和.NET中的new UTF8Encoding.getBytes(String value) ,以确保字符编码匹配。 请注意,现代加密基于字节,而不是字符串或字符。 使用System.Buffer.BlockCopy()来编码字符真的是不好的做法。 The problem is probably the character encoding. You should use for instance t ...
  • 嗨,我认为这可能对你有所帮助。 在这里你可以找到计算hmac sha1的链接: http://caligatio.github.io/jsSHA/ 在这里,您可以在javascript中找到源代码。 https://github.com/Caligatio/jsSHA/releases/tag/v1.5.0 Hi i think this might be helpful for you. Here you can find out the link to calculate hmac sha1: http ...
  • JavaScript现在具有WebRTC,其中两个客户端可以进行对等通信,这将是客户端可以生成和使用自己的“秘密”的情况。 在某些情况下,客户端 - >服务器也可以使用。 如果您的服务器“动态”为JavaScript提供服务,那么它可以根据客户端当前会话/登录信息插入“秘密”。 假设您正在使用HTTPS(如果不是,可能会有一个人在中间扯掉“秘密”)那么假设与该特定“秘密”签署的服务器的通信(即使在不安全的HTTP上)也属于仅仅是不合理的那个客户。 JavaScript now has WebRTC wher ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)