Accessing Application Asset Files in HTML File

陌路散爱 提交于 2019-12-11 04:15:42

问题


i have an index.html page which calls a android activity method via JS and then that method downloads a html page from server and plces it in input folder on SD Card, after downloading that page app loads it to webView, now the problem is that jQueryMobile.js and jQueryMobile.css file are in applications's assets folder and register.html is in SDcard/input folder, how can i give reference of js and css files in register.html which is downloaded from server.

assets                          SDCard
  -                               -
  -index.html                     -
  ---js                           -input
      -                              -
      -                              - register.html
      - jQueryMobile.js
      - jQueryMobile.css

i need to put refence of css and js filed here in head of register.html

<link rel="stylesheet" href="??\jquery.mobile-1.4.2.min.css">
<script src="??\jquery.js"></script>
<script src="??\jquery.mobile-1.4.2.min.js"></script>

Problem Solved by Using

<link rel="stylesheet" href="file:///android_asset/js/jquery.mobile-1.4.2.css">
<script src="file:///android_asset/js/jquery.js"></script>
<script src="file:///android_asset/js/jquery.mobile-1.4.2.js"></script>

来源:https://stackoverflow.com/questions/22524714/accessing-application-asset-files-in-html-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!