Skip to content Skip to sidebar Skip to footer

Can I Make A Html File In Documents Directory Which Accesses Jquery And Cordova In The App Bundle?

I am building a html file which is stored in [[PROJ UserDirectory] stringByAppendingPathComponent:@'tmp_Form_File.html'] and inside of the file 'tmp_FOrm_File.html' it is being d

Solution 1:

This is happening because your references are not working. When you want your HTML to be rendered in webview with some relative paths inside it, you have add it like using the option "Create folder references for added folder".

If this html pages are not going to fetch and store any data, then keep it in bundle, otherwise copy them to Library or document's folder in Appdelegate.

Hope this helps!

Like this


Solution 2:

I couldnt reference it atm, but i resolved it this way: - I copied the contents of [BUNDLE]/html to Documents....

    NSString * sourcePath = [[[NSBundle mainBundle] pathForResource:@"cordova-2.2.0" ofType:@"js" inDirectory:@"html"] stringByDeletingLastPathComponent];
    NSString * documentDirectory = [AssetInspectorFileManager UsersDirectory];
  • adjusted the src of the javascript.

    < script type=\"text/javascript\" src=\"cordova-2.2.0.js\">

    < script type=\"text/javascript\" src=\"jquery-1.7.2.min.js\">

  • Closed a missing parenthese

    " $(\"div.container\").css(\"z-index\",1;"

became

 "   $(\"div.container\").css(\"z-index\",1);"
  • Coomenting is not good to do for this, as when you write data out such as:

    $(this).click(function(){//[THIS IS A COMMENT] alert("hi");});

So you have to adjust for that sort of issue.


Post a Comment for "Can I Make A Html File In Documents Directory Which Accesses Jquery And Cordova In The App Bundle?"