创建类似于fb:标签 [英] Create similar to fb:tag

查看:148
本文介绍了创建类似于fb:标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建类似于fb:tag的东西。

例如,如果您在代码中放置fb:comments,它会显示您在Facebook上的评论。



因为您需要在您的HTML头中包含Facebook xmlns。



如何创建我自己的标签例如:< myEncrypt:key>加密的单词< / myEncrypt:key>



这可能吗?我觉得是这样的。有人可以给我一些指导如何实现这一目标吗?

感谢 它实际上是通过javascript完成的(如果你正在讨论把fb:...放在html中)。所有你需要做的就是在文件加载时解析DOM树,以找到特定的标签/前缀,并根据需要进行处理。您可以使用jQuery或dojo等进行复杂的查询。在dojo中使用了相同的概念,但在标签上使用自定义属性。

 < button data-dojo-type =dijit.form.Buttontype =button> 


I would like to create something similar to fb: tag.

For example if you put fb:comments in your code it would display your comments from Facebook.

Ofcourse you need to include the Facebook xmlns in your HTML head.

How can I create my own tags to perform for example encryption?

For example: <myEncrypt:key>encrypted word</myEncrypt:key>

Is that possible? I think it is. Can someone give me some directions on how to achive that?

Thanks

解决方案

Its actually done by javascript (if you are talking about puting fb:... in html). All that you need to do is parse the DOM tree on load of document for particular tag/prefix and process as needed. You can use jQuery or dojo etc for complex queries. Same concept used in dojo for widgets but with custom attribute on tag.

<button data-dojo-type="dijit.form.Button" type="button">

这篇关于创建类似于fb:标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆