asihttprequest *request=[asidataservice get_path:path completed:^ (id JSON, NSString *stringdata) { //get to HTML info //nslog (@ "jason%@,stringdata%@", Json,stringdata); //Modifying HTML information nsstring *htmlstring=[stringdata stringbyreplacingoccurrencesofstring:@ "Http://s.fwxgx.com/jquery_mobile/jquery.mobile-1.4.5.min.css" withstring:@ "Jquery.mobile-1.4.5.min.css"]; htmlstring=[ htmlstring stringbyreplacingoccurrencesofstring:@ "Http://s.fwxgx.com/jquery_mobile/jquery-1.11.1.min.js" withstring:@ "Jquery-1.11.1.min.js"]; htmlstring=[ htmlstring stringbyreplacingoccurrencesofstring:@ "http://s.fwxgx.com/jquery_mobile/ Jquery.mobile-1.4.5.min.js " withstring:@" jquery.mObile-1.4.5.min.js "]; //htmlstring=[stringdata stringbyreplacingoccurrencesofstring:@ "/survey/save_train_survey" withstring:@ "http://gmsa.fwxgx.com/ Survey/save_train_survey "]; //write to local file /* nsstring *successpath = [nshomedirectory () stringbyappendingpathcomponent:@ "Documents/success.text"]; nsarray *[email protected][[nsstring stringwithformat:@ "%@/%@", filepath,name]]; nsdictionary *[email protected]{@ " Root ":successarray}; BOOL success = [dic writeToFile:successPath atomically:YES]; */&nBsp; nslog (@ "/n html%@", htmlstring); [webview loadhtmlstring:htmlstring baseurl:[nsurl fileurlwithpath:[ [nsbundle mainbundle] bundlepath]]]; [self.view addSubview:webView]; } failed:^ (Nserror *error) { nslog (@ "Data failed"); }];
JS files can only be manually placed inside the COPYRESOURC, not as a compiled file, in addition, because the HTML string is too long, the compiler will not display all
Ioswebview loading Local JS