문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top