【问题标题】:URL parameters stripped on Google Sites?在 Google 协作平台上剥离 URL 参数?
【发布时间】:2013-05-02 13:15:59
【问题描述】:

使用 Google Apps 脚本小工具,我可以使用添加到 Google 协作平台网页的 URL (http://sites.google.com/.../my-page?urlparameter=value&otherurlparameter=value) 的参数来生成动态内容。

但是,如果您尝试使用参数添加指向 Google 站点页面的链接,然后保存您的页面,则参数将被删除:http://sites.google.com/.../my-page?urlparameter=value&otherurlparameter=value 变为 http://sites.google.com/.../my-page。尝试使用 Apps 脚本服务 SitesApp.Page.setHtmlContent(yourHmtl) 发布网页时也是如此。

使用外部 URL 时不会发生这种情况。 我们如何绕过这个限制?

【问题讨论】:

    标签: google-apps-script google-sites


    【解决方案1】:

    可以包含 relative 指向包含参数的页面的链接。

    示例: 在http://sites.google.com/.../home/page-1, http://sites.google.com/.../home/page-2?urlparameters 之类的链接将在没有参数的情况下被覆盖,但 ../page-2?urlparameters 不会。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-13
      • 1970-01-01
      • 1970-01-01
      • 2018-07-19
      • 2021-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多