Question

I'm looking to pass some config data from a webview to an app. I think the best way to do this is to link to a file that contains all the information. What's the best way to add the link to the web view page?

Is something like:

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

Appropriate for the app to read? Or should I use a custom element in the header where I can pass more data if needed, such as:

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

Is there an advantage of one versus the other for reading the web view content from the app?

Était-ce utile?

La solution

I did this previously with meta tags, no issues to report yet. However, I structured it in this way:

<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">

This seems more readable to me and gives you room to add and read more properties easily

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top