UIWebViewにhtml文字列を読み込もうとすると問題が発生します。これは私がしていることです
NSString *temp = [[NSString alloc] initWithFormat:@"<head><script type='text/javascript' src='code39.js'></script><style type='text/css'>#barcode {font-weight: normal; font-style: normal; line-height:normal; sans-serif; font-size: 12pt}</style></head><body><script type='text/javascript'>function get_object(id) {var object = null;if (document.layers) {object = document.layers[id];} else if (document.all) {object = document.all[id];}return object;}get_object('barcode').innerHTML=DrawCode39Barcode('%@',2);</script></body>",[count objectAtIndex:i]];
[mainWebView loadHTMLString:temp baseURL:nil];
だからここに問題があります:
<script type='text/javascript' src='code39.js'>
アプリケーションにcode39.jsファイルを追加して、HTMLがファイルにアクセスしてUIWebviewにロードできるようにするにはどうすればよいですか。
助けてください...