Create similar to fb:tag

2019-02-20 17:35发布

问题:

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

回答1:

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">