【问题标题】:How to open documents that contain certain characters through WebDav?如何通过WebDav打开包含特定字符的文档?
【发布时间】:2011-02-09 10:21:46
【问题描述】:

我使用 ActiveXObjects 通过 WebDav 使用在线服务根据以下内容编辑文档:

function openWithWebDAVCallback(data, xmlObj)
{
    var document = new ActiveXObject("SharePoint.OpenDocuments.2");
    var documentPath = xmlObj.getElementsByTagName('davUrl')[0].firstChild.nodeValue;
    document.EditDocument(documentPath);
}

但是,有时documentPath 会包含一个数字符号 (#),这会导致 EditDocument 崩溃并且不允许访问该文档。我尝试用"& # 3 5 ;" 替换数字符号但没有成功。

如何允许在文档名称中使用 #、?、= 等特殊字符,同时仍允许用户通过 WebDav 访问它们?

【问题讨论】:

    标签: javascript ms-word webdav


    【解决方案1】:

    # 表示 URL 中的“开始片段标识符”。

    您需要为 URL 编码,而不是 HTML。

    在 JavaScript 中:encodeURIComponent

    【讨论】:

      猜你喜欢
      • 2015-03-24
      • 1970-01-01
      • 2016-04-11
      • 2014-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多