jquery - 如何 append xmlns :fb ="http://www.facebook.com/2008/fbml" to my CMS's html tag

标签 jquery facebook append xml-namespaces

我想知道如何将这些属性添加到由我们封闭的 CMS 系统自动生成的 html 标记中。

我想添加到我们当前的 html 标签中:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

对此:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="http://www.facebook.com/2008/fbml">

有什么方法可以使用 JQuery 做到这一点吗?

最佳答案

$(function () {
    $("html").attr("xmlns:og","http://ogp.me/ns#");
}

HTML 标记中的 XML 命名空间属性很少与页面行为相关。

关于jquery - 如何 append xmlns :fb ="http://www.facebook.com/2008/fbml" to my CMS's html tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4892686/

相关文章:

jquery - Dragdealer.js 查找步骤的值

Facebook Graph Explorer 给出的结果与具有相同权限的 Graph API 请求不同

测试应用程序上的 Facebook Invalid Scopes 错误

java - 为什么我无法从 Facebook 获取生日信息

JavaScript - 保存、存储和更新数组

php - jQuery/AJAX 登录表单在输入时提交

javascript - 在 jQuery 中搜索和突出显示

javascript - 使用 jQuery .append 时,子级的父级不会得到更新

arrays - 在 GO 语言中删除和添加元素到数组

r - 如何有条件地将数据框行 append 到上面的行