zoukankan      html  css  js  c++  java
  • 上火啊,替换字符串,HTML,

    -(void)webViewDidFinishLoad:(UIWebView *)webView

    {

        JSContext *jsContext = [webView valueForKeyPath: @"documentView.webView.mainFrame.javaScriptContext"];

        jsContext[@"ocObj"] = self;

        //设置高度

        JSValue *jHeight  = [jsContext evaluateScript:@"document.body.scrollHeight"];

        self.mWebView.scrollView.contentSize = CGSizeMake(screenW, [jHeight toDouble]);

     

        JSValue *kContent = [jsContext evaluateScript:@"document.getElementById('guligei').innerHTML"];

        NSString *kName = [kContent toString];

        NSString *replaced = [kName stringByReplacingOccurrencesOfString:@"${studentName}" withString:@"战歌"];

        NSString *jsString = [NSString stringWithFormat:@"document.getElementById('stuName').innerHTML='%@'",replaced];

        [jsContext evaluateScript:jsString];

    }

     

     

                        returnStr =[returnStr stringByReplacingOccurrencesOfString:@"${studentName}" withString:SharedAppDelegate.userInfo.name];

  • 相关阅读:
    正文提取2
    使用mysqlimport导入数据
    batch_get_real_image_urls.py 博源
    用于网页分类的python工具包
    python learning base 不错
    20101010网站更新部署
    20101010网站更新部署
    正文提取
    python property
    jquery slideUp()
  • 原文地址:https://www.cnblogs.com/guligei/p/4773556.html
Copyright © 2011-2022 走看看