在html4页面上创建html5元素? doctype无法更改

时间:2017-02-24 01:00:28

标签: javascript html html5 firefox html4

我们有两个示例网站:

http://fastpic.ru/(html4 doctype)

http://imagebam.com/(html5 doctype)

我需要通过javascript(userscript)在两个网站上创建一个html5元素,该元素为<a>,带有download属性,

如果您尝试在html4(1st)网站上设置download属性它根本不起作用,您单击它 - 它只是在您单击时打开链接,没有download html5行为

那么,有没有办法在html4网站上创建和使用html5元素?

编辑:发现firefox不允许跨域(甚至是子域名)download属性......该死的,没有什么能像火狐那样工作......

1 个答案:

答案 0 :(得分:-2)

您可以尝试在html4页面的头部添加此内容

public partial class RCMR_IN000030UV01
{
    [XmlNamespaceDeclarations]
    public XmlSerializerNamespaces xmlsn
    {
        get
        {
            var ns = new XmlSerializerNamespaces();
            ns.Add("x", "urn:bccdx.ca");
            return ns;
        }
        set
        {
            // Do nothing - fake property.
        }
    }
}
相关问题