I am working on a web application for iphone, I created a new css
project for the project, this css file does not affect the html file, but when I uploaded the css file to the host, it worked fine and in html style
what is the problem?
change 1
this element of the head.
css.css
works fine and is correctly attached to html
jquery.mobile-1.0.min.css
NOT!
although both files exist on the same border
Onotha.com
<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.0.min.css" />
change 2
This is objectve-c
code, I have an exception, I think in the last line of code
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [window makeKeyAndVisible]; NSString *path= [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:NO]; // [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]]]; // NSString *path = [[NSBundle mainBundle] bundlePath]; // NSURL *baseURL = [NSURL fileURLWithPath:path]; // [webView loadHTMLString:htmlString baseURL:baseURL]; // load css styles NSString *cssPath = [[NSBundle mainBundle] pathForResource:@"css/jquery.mobile-1.0.min.css" ofType:@"css"]; NSData *cssData = [NSData dataWithContentsOfFile:cssPath]; NSString *cssString = [[NSString alloc] initWithData:cssData encoding:NSASCIIStringEncoding]; // load js NSString *jsPath = [[NSBundle mainBundle] pathForResource:@"MyJS" ofType:@"js"]; NSData *jsData = [NSData dataWithContentsOfFile:jsPath]; NSString *jsString = [[NSString alloc] initWithData:jsData encoding:NSASCIIStringEncoding]; // compose full html page NSString *pageContent = [NSString stringWithFormat:@"%@%@%@", cssString, jsString, path]; [webView loadHTMLString:pageContent baseURL:baseURL]; return YES; }
edit 3
I got this after using the code posted by Srikar
source share