我苦苦思索了很久,想不出html、css、javascript和iframe解决不了的问题。
有人可以阐明 FBML 和 google g 标记语言存在背后的推理吗?它们如何以及使什么变得更容易?
g:plusone示例(例如添加“like”按钮时使用的代码):
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="tall"></g:plusone>
或facebook fbml示例-(例如添加facebook“like”按钮时使用的代码):
<fb:like send="false" layout="box_count" width="450" show_faces="true" action="recommend" font="verdana"></fb:like>
<html xmlns:fb="https://www.facebook.com/2008/fbml">
查看上面的示例- 我们不能简单地将
<g and <fb
元素替换为具有 facebook 或 plusone 类的 div 吗?
PS 不确定 g 是否是一种语言 - 至少我在谷歌搜索时找不到任何关于它的信息。当他们使用像 g 或 c 这样的单字符名称时真的很糟糕。
I thought long and hard and can't think of problems that cannot be solved by html, css, javascript and iframes.
Can somebody shed some light on reasoning's behind FBML and google g markup languages existance. How and what do they make easier?
g: plusone example (code used when adding like button for example):
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="tall"></g:plusone>
or facebook fbml example - ( code used when adding facebook like button for example):
<fb:like send="false" layout="box_count" width="450" show_faces="true" action="recommend" font="verdana"></fb:like>
<html xmlns:fb="https://www.facebook.com/2008/fbml">
Looking on example above - can't we simply replace
<g and <fb
elements with divs that have facebook or plusone class for example?
P.S. not sure if g is a language - at least I couln't find anything about it while googling. Really sucks when they use these single character names like g or c.
发布评论
评论(1)
这可能是为了避免命名空间问题。
如果您使用 DIV 实现此目的,则必须 100% 确保您选择的类名是唯一的,以便它不会与用户的类冲突。例如
因此 Google 必须想出丑陋的类名,如“google----plusone”等。指定一个新的 XML 命名空间并将其代码放入其中要优雅得多。
It's probably to avoid namespacing issues.
If you implement this with a DIV you have to make 100% sure that the classname you choose is unique, so that it doesn't conflict with the user's classes. For example
<div class="google-plusone"
would not be a good name because what if the user wrapped this code into his own container and named it "google-plusone" too (not unlikely)?So Google would have to come up with ugly class names like "google----plusone", etc. It's much more elegant to specify a new XML namespace and put their code inside.