【问题标题】:Passing config data from webview to app将配置数据从 webview 传递到应用程序
【发布时间】:2014-01-31 13:38:07
【问题描述】:

我希望将一些配置数据从 web 视图传递到应用程序。我认为最好的方法是链接到包含所有信息的文件。将链接添加到网页视图页面的最佳方式是什么?

类似于:

<head>
  <meta name="my-app-config" content="http://my-app-ulr.com/config.xml">
</head>

适合应用阅读吗?或者我应该在标题中使用自定义元素,如果需要,我可以在其中传递更多数据,例如:

<head>
  <my-app type="config">http://my-app-ulr.com/config.xml"</my-app>
</head>

从应用程序中读取 Web 视图内容是否有优势?

【问题讨论】:

    标签: android ios xml webview naming


    【解决方案1】:

    我之前使用元标记进行过此操作,目前还没有要报告的问题。但是,我是这样组织的:

    <meta name="my-app-properties" content="things of interest to my app" my-app-config="http://my-app-ulr.com/config.xml" my-other-property="more things">
    

    这对我来说似乎更具可读性,并为您提供了轻松添加和阅读更多属性的空间

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-20
      • 1970-01-01
      • 1970-01-01
      • 2016-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      相关资源
      最近更新 更多