在local端寫html , javascript & css都沒有出現?

18 views
Skip to first unread message

amos

unread,
Mar 21, 2012, 3:49:24 AM3/21/12
to cocoaheads.tw
板上的大大我在在objective c中local的html中的javascript & css要如何顯示?
有讀取到檔案但模擬器跑出來都是一片空白
NSString *htmlFile = [[NSBundle mainBundle]
pathForResource:@"htmlTest" ofType:@"html" inDirectory:NO];
NSString *htmlString = [NSString stringWithContentsOfFile:htmlFile
encoding:NSUTF8StringEncoding error:NO];
NSLog(@"%@",htmlString);
[webView loadHTMLString:htmlString baseURL:nil];

htmlTest 在html檔案的import如下檔案開啓都正常顯示:
<script type="text/javascript" src="js/mytest.js"></script>
<link rel="stylesheet" href="css/mytest.css">

Evadne Wu

unread,
Mar 21, 2012, 4:05:47 AM3/21/12
to cocoah...@googlegroups.com
Please post the entire project and send the link in the reply.

> --
> 您已訂閱「Google 網上論壇」的「cocoaheads.tw」群組,因此我們特別傳送這封郵件通知您。
> 如要在此群組張貼留言,請傳送電子郵件至 cocoah...@googlegroups.com
> 如要取消訂閱此群組,請傳送電子郵件至 cocoaheadstw...@googlegroups.com
> 如需更多選項,請造訪此群組:http://groups.google.com/group/cocoaheadstw?hl=zh-TW
>

Amos Ho

unread,
Mar 21, 2012, 6:29:09 AM3/21/12
to cocoah...@googlegroups.com
here:
http://www.shacial.com/download/124682/Test.zip
--

 best regards
 Amos

Weizhong Yang

unread,
Mar 21, 2012, 1:12:12 PM3/21/12
to cocoah...@googlegroups.com
簡單改了一下

http://d.pr/c2NR

Cheers,
zonble

--
Weizhong Yang (a.k.a zonble)
http://zonble.net
zon...@gmail.com


Amos Ho 於 Mar 21, 2012 6:29 PM 寫道:

> here:
> http://www.shacial.com/download/124682/Test.zip
>

Amos Ho

unread,
Mar 21, 2012, 1:46:46 PM3/21/12
to cocoah...@googlegroups.com
感謝
zonble前輩

>

--
您已訂閱「Google 網上論壇」的「cocoaheads.tw」群組,因此我們特別傳送這封郵件通知您。
如要在此群組張貼留言,請傳送電子郵件至 cocoah...@googlegroups.com
如要取消訂閱此群組,請傳送電子郵件至 cocoaheadstw...@googlegroups.com
如需更多選項,請造訪此群組:http://groups.google.com/group/cocoaheadstw?hl=zh-TW




--

 best regards
 Amos
Reply all
Reply to author
Forward
0 new messages