zoukankan      html  css  js  c++  java
  • UIWebView加载本地页面

    Address:http://www.cnblogs.com/haipingwu/archive/2011/03/18/1987968.html

    //加载Bundle中的html文件。
    NSString *Path = [[NSBundle mainBundle] pathForResource:@"chat.html" ofType:nil];
    [WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:Path]]];

    // 执行其中的Javascript
    NSString *str = [NSString stringWithFormat:@"addmsg(\"%c%c%c\")", 'A', 'A', 'A'];

    NSString
    *Value = [WebView stringByEvaluatingJavaScriptFromString:str];
    NSLog(
    @"%@", Value);


    // 加载字符串html代码,并且显示其中的资源文件。
    NSString *html =@"<html><body><img src='a.png'></body></html>";
    NSString
    *path = [[NSBundle mainBundle] bundlePath];
    NSURL
    *base= [NSURL fileURLWithPath:path];

    [WebView loadHTMLString:html baseURL:
    base];

  • 相关阅读:
    VisualVM工具的使用
    jstack的使用
    JVM内存溢出的定位与分析
    初识JVM
    JVM运行参数
    VIM 常用命令
    python3 简单抓取图片2
    python3 抓取图片
    node.js GET 请求简单案例
    node.js 爬虫
  • 原文地址:https://www.cnblogs.com/xingchen/p/2946234.html
Copyright © 2011-2022 走看看