JS 定义了一个变量, ios 怎样赋值?
[pCoreHandle startAsWebClient];
NSString* pFilePath = [NSString stringWithFormat:@"file://%@/%@", [NSBundle mainBundle].bundlePath, @"Pandora/apps/HelloH5/www/index2.html"];
CGRect StRect = CGRectMake(0, 20, self.view.frame.size.width, self.view.frame.size.height - 20);
appFrame = [[PDRCoreAppFrame alloc] initWithName:@"aaaaa" loadURL:pFilePath frame:StRect];
NSString* pStringDocumentpath = [NSString stringWithFormat:@"%@/Pandora/apps/HelloH5/www/", [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0]];
NSLog(@"%@",pStringDocumentpath);
[pCoreHandle.appManager.activeApp.appInfo setWwwPath:pStringDocumentpath];
[pCoreHandle.appManager.activeApp.appWindow registerFrame:appFrame];
[self.view addSubview:appFrame];
ios_xi (作者)
<script>
var youhui_domain = '';
var img_domain = '';
var token = '';
</script>
[self.view addSubview:appFrame];
我是在addsubView 之后就要给 js 里面的 那些变量 要赋值!
[appFrame stringByEvaluatingJavaScriptFromString:@"tesVar='这样玩奥'"];
这个是没有赋值到的
2015-05-28 10:57
DCloud_IOS_XTY
tesVar是个示例变量要换成你自己实际的变量,这个要JS Context有效时才能行,比如可以监听页面加载完成事件在执行JS
2015-05-28 14:20