javascript - Loading .js file in UIWebview from bundle downloaded as a zip -


i want show "complete website" (which packaged in bundle) in uiwebview.

when put bundle in xcode , adding "compile stuff", loaded, js files works fine.

unfortunately, permit update website, need 1 downloaded zip server... can zip, extract , put in bundle when load index page in uiwebview, js files aren't working !

how can set make code executable or ?

here part load bundle created :

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *test = [[nsbundle bundlewithpath:documentsdirectory] pathforresource:@"contentnewversion.bundle/index" oftype:@"html"];  [_webview  loadrequest:[nsurlrequest  requestwithurl:[nsurl fileurlwithpath:test isdirectory:no]]]; 

the location of index : /var/mobile/applications/a2b602c3-dec0-40fe-9469-288f666196a7/documents/contentnewversion.bundle/index.html `

// try this

 nsstring *test = [[nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) objectatindex:0] stringbyappendingpathcomponent:@"/contentnewversion.bundle/index.html"];  nslog(@"%@",test);  [webview loadrequest:[nsurlrequest requestwithurl:[nsurl fileurlwithpath:test]]]; 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -