问题
I'm currently making a facebook application and while investigating the (X)HTML source code for a message thread page to see if it was possible to link to specific messages within threads (apparently it's not), I encountered an HTML attribute that I cannot seem to find any information about. Some span elements on the page had a 'bindpoint' attribute that was set to various values (presumably element IDs). Here is an excerpt from the page source (I replaced some private info with Xs)
<div class="GBThreadMessageRow_Info">
<span class="GBThreadMessageRow_AuthorLink_Wrapper" bindpoint="authorLinkWrapper">
<a href="http://www.facebook.com/profile.php?id=XXXXXXXXX" class="GBThreadMessageRow_AuthorLink">XXXXXXXX</a>
</span>
<span class="GBThreadMessageRow_Date">
April 8, 2010 at 10:13pm
</span>
<span bindpoint="branchLinkWrapper" class="GBThreadMessageRow_BranchLink"><a href="/ajax/messaging/composer.php?thread=XXXXX&msg_id=XXXXX&id=XXXXXX" rel="dialog-post">Reply</a></span>
<span bindpoint="reportLinkWrapper" class="GBThreadMessageRow_ReportLink"> • <a href="/ajax/report.php?content_type=9&cid=XXXXX&rid=XXXXX&cid2=XXXX&cid3=X&h=XXXXX" rel="dialog" class="action">Report</a></span>
</div>
I have never seen this attribute before and any information about it would be useful/helpful/interesting. Thanks!
回答1:
As was said in the comments, it has to be something they're doing in the javascript code.
Facebook uses an interesting technique to import their javascript files dynamically (basically they seem to write out script
tags in the javascript, when necessary), and it's not quite as simple as just pressing ctrl-F through the first file you find.
So, in conclusion, the bindpoint
attribute is something internal to the Facebook eco-system, and not standard HTML. From the name, I assume it has something to do with which events (clicks, mouseovers, etc.) should be binded to the element in question, which is signified by a variable name give in the bindpoint
attribute. Or maybe it has to do with which element the element in question should be 'binded' to, like the for
attribute for a label. Anyway, this is pure speculation.
来源:https://stackoverflow.com/questions/4607582/what-does-the-html-bindpoint-attribute-do