<legend id='nYgoq'><style id='nYgoq'><dir id='nYgoq'><q id='nYgoq'></q></dir></style></legend>

      <bdo id='nYgoq'></bdo><ul id='nYgoq'></ul>
  1. <i id='nYgoq'><tr id='nYgoq'><dt id='nYgoq'><q id='nYgoq'><span id='nYgoq'><b id='nYgoq'><form id='nYgoq'><ins id='nYgoq'></ins><ul id='nYgoq'></ul><sub id='nYgoq'></sub></form><legend id='nYgoq'></legend><bdo id='nYgoq'><pre id='nYgoq'><center id='nYgoq'></center></pre></bdo></b><th id='nYgoq'></th></span></q></dt></tr></i><div id='nYgoq'><tfoot id='nYgoq'></tfoot><dl id='nYgoq'><fieldset id='nYgoq'></fieldset></dl></div>

    <tfoot id='nYgoq'></tfoot>

      <small id='nYgoq'></small><noframes id='nYgoq'>

    1. UIWebView 不加载外部 Javascript 文件

      UIWebView doesn#39;t load external Javascript file(UIWebView 不加载外部 Javascript 文件)
    2. <legend id='JBNxz'><style id='JBNxz'><dir id='JBNxz'><q id='JBNxz'></q></dir></style></legend>
          • <small id='JBNxz'></small><noframes id='JBNxz'>

              <tbody id='JBNxz'></tbody>
              <bdo id='JBNxz'></bdo><ul id='JBNxz'></ul>
              1. <i id='JBNxz'><tr id='JBNxz'><dt id='JBNxz'><q id='JBNxz'><span id='JBNxz'><b id='JBNxz'><form id='JBNxz'><ins id='JBNxz'></ins><ul id='JBNxz'></ul><sub id='JBNxz'></sub></form><legend id='JBNxz'></legend><bdo id='JBNxz'><pre id='JBNxz'><center id='JBNxz'></center></pre></bdo></b><th id='JBNxz'></th></span></q></dt></tr></i><div id='JBNxz'><tfoot id='JBNxz'></tfoot><dl id='JBNxz'><fieldset id='JBNxz'></fieldset></dl></div>
                <tfoot id='JBNxz'></tfoot>
                本文介绍了UIWebView 不加载外部 Javascript 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有以下看似无辜的代码 (index.html),但它不加载 code.js 文件.如果我在 HTML 页面中复制/粘贴文件的内容,它会很好地工作.index.htmlcode.js 文件都在同一个目录中.这是代码片段.任何帮助都会很棒.

                I have the following innocent-looking code (index.html), but it doesn't load the code.js file. It works well if I copy/paste the contents of the file in the HTML page. Both index.html and code.js files are in the same directory. This is the code snippet. Any help would be great.

                index.html:

                index.html :

                <html>
                <head>
                <script type="text/javascript" src="code.js"></script>
                </head> 
                <body onload="drawImage()">
                  <div><canvas id="canvas" width="320" height="480"></canvas></div> 
                </body>
                </html>
                

                ViewController.m:

                ViewController.m:

                - (void)viewDidLoad {
                  [super viewDidLoad];
                // load the first webpage
                [homePageWebView loadRequest:[NSURLRequest requestWithURL:[NSURLfileURLWithPath:
                  [[NSBundle mainBundle] pathForResource:@"index"ofType:@"html"] isDirectory:NO]]];
                }
                

                推荐答案

                发现Xcode认为需要编译js文件.

                I have found that Xcode thinks that the js file needs to be compiled.

                在 Xcode 中打开项目.转到目标"并查看编译源".如果您在该文件夹中看到您的 js 文件,请将其移至Copy Bundle Resources"文件夹并从Compile Sources"文件夹中删除.

                Open the project in Xcode. Go to "Targets" and look in "Compile Sources". If you see your js file in that folder, move it to the "Copy Bundle Resources" folder and delete it from the "Compile Sources" folder.

                如果您的 iPhone 已经安装了该应用以进行测试,请从您的 iPhone 中删除该应用.转到 Xcode 中的 Build 菜单并 Clean all Targets.然后重新编译.

                Delete the app from your iPhone if it is installed already for testing. Go to the Build menu in Xcode and Clean all Targets. Then recompile.

                现在检查你的 HTML 文件是否真的能看到你的 js 文件.

                Check now to see if your HTML file actually sees your js file now.

                琳达

                这篇关于UIWebView 不加载外部 Javascript 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Pause youtube video, youtube api(暂停 youtube 视频,youtube api)
                Youtube iframe api not triggering onYouTubeIframeAPIReady(Youtube iframe api 未触发 onYouTubeIframeAPIReady)
                How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                Embed YouTube video - Refused to display in a frame because it set #39;X-Frame-Options#39; to #39;SAMEORIGIN#39;(嵌入 YouTube 视频 - 拒绝显示在框架中,因为它将“X-Frame-Options设置为“SAMEORIGIN)
                How to call Greasemonkey#39;s GM_ functions from code that must run in the target page scope?(如何从必须在目标页面范围内运行的代码中调用 Greasemonkey 的 GM_ 函数?)
                How do you mute an embedded Youtube player?(如何使嵌入式 Youtube 播放器静音?)
                <legend id='rAEas'><style id='rAEas'><dir id='rAEas'><q id='rAEas'></q></dir></style></legend>
                    <tbody id='rAEas'></tbody>

                  <tfoot id='rAEas'></tfoot>
                  • <bdo id='rAEas'></bdo><ul id='rAEas'></ul>
                      • <i id='rAEas'><tr id='rAEas'><dt id='rAEas'><q id='rAEas'><span id='rAEas'><b id='rAEas'><form id='rAEas'><ins id='rAEas'></ins><ul id='rAEas'></ul><sub id='rAEas'></sub></form><legend id='rAEas'></legend><bdo id='rAEas'><pre id='rAEas'><center id='rAEas'></center></pre></bdo></b><th id='rAEas'></th></span></q></dt></tr></i><div id='rAEas'><tfoot id='rAEas'></tfoot><dl id='rAEas'><fieldset id='rAEas'></fieldset></dl></div>
                      • <small id='rAEas'></small><noframes id='rAEas'>