Ioswebview loading Local JS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.