2

我想在 iphone 中使用 mobilscroll jQuery 加载日期选择器。所以我在 xcode 中删除了 mobiscroll 的那些文件。我在 webview 中调用了 index.html。但是在 Webview 中我什么也没得到。什么都没有显示。请帮忙

4

1 回答 1

0

There are many ways to get empty screen. You should check all of the below items:

  1. Remove js,html and css files from the Compile Sources and add them to the Copy Bundle Resources
  2. You should be careful about the location of the JS and CSS files in the HTML files. Such as, when i develop UIWebView apps, I just copy the all of the js and css files to the documents directory in the AppDelegate file.

    NSString *jsFile2 = [documentDir stringByAppendingPathComponent:@"jquery-1.8.2.min.js"];
    NSString *jsFile2Path = [[NSBundle mainBundle] pathForResource:@"jquery-1.8.2.min" ofType:@"js"];
    [fileManager copyItemAtPath:jsFile2Path toPath:jsFile2 error:nil];
    

Then, you can directly add css and js files to your html like that; <script type='text/javascript' src='jquery.min.js'></script>

These are my concerns when I develop apps using UIWebView...

于 2013-01-09T15:45:46.853 回答